Skip to content

Commit

Permalink
Transport layer and middleware are coming together
Browse files Browse the repository at this point in the history
  • Loading branch information
a20r committed Jan 31, 2016
1 parent 9fcf1d1 commit 18896b7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 74 deletions.
22 changes: 22 additions & 0 deletions scripts/run_server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), "../src"))

import server
from twisted.python import log
from twisted.internet import reactor
from autobahn.twisted.websocket import WebSocketServerFactory


def run_server():
log.startLogging(sys.stdout)
factory = WebSocketServerFactory("ws://localhost:9000", debug=True)
factory.protocol = server.MMServerProtocol
reactor.listenTCP(9000, factory)
reactor.run()


if __name__ == "__main__":
run_server()
2 changes: 1 addition & 1 deletion src/client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ def send_message(self, payload):
return MMClient.send_message(payload)

def updates(self):
payloads = copy.deepcopy(MMClient.updates)
payloads = copy.copy(MMClient.updates)
MMClient.updates = dict()
return payloads
2 changes: 0 additions & 2 deletions src/client/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ def __init__(self, host, port, name, topics):
def run(self):
for topic, msg_type in self.topics:
self.create_subscriber(topic, msg_type)
r = rospy.Rate(30)
while not rospy.is_shutdown():
updates = self.conn.updates()
for v in updates.values():
self.pub_man.publish(v)
r.sleep()

def create_subscriber(self, topic, msg_type):
namespace, msg_name = msg_type.split("/")
Expand Down
71 changes: 0 additions & 71 deletions tests/ws_test.py

This file was deleted.

0 comments on commit 18896b7

Please sign in to comment.