Skip to content

Commit bfe733b

Browse files
committed
Remove unnecessary code
1 parent 5496719 commit bfe733b

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/roslibpy/comm/comm_autobahn.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,10 @@
2323
class AutobahnRosBridgeProtocol(RosBridgeProtocol, WebSocketClientProtocol):
2424
def __init__(self, *args, **kwargs):
2525
super(AutobahnRosBridgeProtocol, self).__init__(*args, **kwargs)
26-
self.headers = {}
2726

2827
def onConnect(self, response):
2928
LOGGER.debug("Server connected: %s", response.peer)
3029

31-
def getHandshakeRequestHeaders(self):
32-
headers = super(AutobahnRosBridgeProtocol, self).getHandshakeRequestHeaders()
33-
for key, value in self.headers.items():
34-
headers.append((key, value))
35-
return headers
36-
3730
def onOpen(self):
3831
LOGGER.info("Connection to ROS ready.")
3932
self._manual_disconnect = False
@@ -69,20 +62,13 @@ class AutobahnRosBridgeClientFactory(EventEmitterMixin, ReconnectingClientFactor
6962

7063
protocol = AutobahnRosBridgeProtocol
7164

72-
def __init__(self, *args, headers=None, **kwargs):
65+
def __init__(self, *args, **kwargs):
7366
super(AutobahnRosBridgeClientFactory, self).__init__(*args, **kwargs)
74-
self.headers = headers or {}
7567
self._proto = None
7668
self._manager = None
7769
self.connector = None
7870
self.setProtocolOptions(closeHandshakeTimeout=5)
7971

80-
def buildProtocol(self, addr):
81-
proto = self.protocol()
82-
proto.factory = self
83-
proto.headers = self.headers
84-
return proto
85-
8672
def connect(self):
8773
"""Establish WebSocket connection to the ROS server defined for this factory."""
8874
self.connector = connectWS(self)

0 commit comments

Comments
 (0)