def _bind(self):
     sock = TCPSocketMaker.create_socket()
     # Bind socket to local host and port
     try:
         sock.bind(("", self.port))
         print self.name + ": Socket bound"
         return sock
     except socket.error, msg:
         print self.name + ": Bind failed. Error Code : " + str(msg[0]) + " Message " + msg[1]
         return None
 def _bind(self):
     sock = TCPSocketMaker.create_socket()
     # Bind socket to local host and port
     try:
         sock.bind(('', self.port))
         print self.name + ': Socket bound'
         return sock
     except socket.error, msg:
         print self.name + ': Bind failed. Error Code : ' + str(
             msg[0]) + ' Message ' + msg[1]
         return None
 def send(self,message,wait_response=False):
     sock = TCPSocketMaker.create_socket()
     msg = message 
     msg = self.message_formatter.format_from_ros_msg(message)
     return self._send(sock,msg,wait_response)
 def test_TCP_socketmaker_create_socket(self):
     sock = TCPSocketMaker.create_socket()
     self.assertTrue(sock is not None)
 def test_TCP_socketmaker_create_socket(self):
     sock = TCPSocketMaker.create_socket()
     self.assertTrue(sock is not None)
Exemple #6
0
 def send(self, message, wait_response=False):
     sock = TCPSocketMaker.create_socket()
     msg = message
     msg = self.message_formatter.format_from_ros_msg(message)
     return self._send(sock, msg, wait_response)