26 from sbp.client.drivers.base_driver
import BaseDriver
27 from sbp.client
import Handler, Framer
28 from collections
import deque
36 self.handle.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
39 self.handle.bind((
"", port))
40 except socket.error, msg:
46 if len(self.
buf) < size:
48 data, addr = self.handle.recvfrom(4096)
50 print "PIKSI UDP ERROR - no data from " + str(addr)
53 except socket.error, msg:
54 print "PIKSI UDP ERROR " + str(msg)
56 res =
''.join([self.buf.popleft()
for i
in xrange(min(size, len(self.
buf)))])
72 self._write_lock.acquire()
73 self.handle.sendall(s)
74 except socket.error, msg:
77 self._write_lock.release()
87 self.socket.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
96 UdpMulticaster.__init__(self, broadcast, port)
106 self.
framer = Framer(self.driver.read,
None, verbose=
False)
def recv_callback(self, msg, metadata)
def __init__(self, port, ext_callback)
def __init__(self, broadcast, port)
def sendSbpPacket(self, sbp_data)
def __init__(self, broadcast, port)
def __init__(self, host, port)
def sendPacket(self, data)