summaryrefslogtreecommitdiff
path: root/src/daq/flumotion-plug
diff options
context:
space:
mode:
Diffstat (limited to 'src/daq/flumotion-plug')
-rw-r--r--src/daq/flumotion-plug/sfive.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/daq/flumotion-plug/sfive.py b/src/daq/flumotion-plug/sfive.py
index c200095..5ec00bd 100644
--- a/src/daq/flumotion-plug/sfive.py
+++ b/src/daq/flumotion-plug/sfive.py
@@ -46,6 +46,7 @@ T_ = i18n.gettexter()
_DEFAULT_POLL_INTERVAL = 5 # in seconds
_RECONNECT_TIMEOUT = 2 # in seconds
+_MAX_PACKET_SIZE = 8192 # in bytes
__version__ = "$Rev$"
@@ -58,19 +59,21 @@ class SFiveProto(protocol.ConnectedDatagramProtocol):
self._plug.debug('SFive: protocol stopped')
def startProtocol(self):
+ self._plug.debug('SFive: protocol started')
self._plug._socketReady()
def datagramReceived(self, data):
self._plug.debug('SFive: received datagram: "%s" (will get ignored)', data)
def connectionFailed(self, failure):
- self._plug.warning('SFive: "%s"', failure.getErrorMessage())
+ self._plug.warning('SFive: connection failed: %s', failure.getErrorMessage())
self._plug._socketError()
def sendDatagram(self, data):
try:
return self.transport.write(data)
- except socket_error:
+ except socket_error as err:
+ self._plug.warning('SFive: sending datagram failed: %s', err)
self._plug._socketError()
@@ -110,12 +113,11 @@ class ComponentSFivePlug(base.ComponentPlug):
self._conn.stopListening()
def _initSocket(self):
- self.debug('SFive: trying to connect to %s...', self._socket)
+ self.info('SFive: trying to (re)connect to %s...', self._socket)
self._proto = SFiveProto(self)
- self._conn = reactor.connectUNIXDatagram(self._socket, self._proto)
+ self._conn = reactor.connectUNIXDatagram(self._socket, self._proto, maxPacketSize=_MAX_PACKET_SIZE)
def _socketError(self):
- self.warning('SFive: connection error ... trying reconnect')
if self._sfivepoller:
self._sfivepoller.stop()
if self._conn:
@@ -132,7 +134,6 @@ class ComponentSFivePlug(base.ComponentPlug):
self._sfivepoller.start()
def _sendInit(self):
- self.debug('SFive: sending init message')
initdata = { "hostname": self._hostname,
"streamer-id": { "content-id": self._content_id, "format": self._format, "quality": self._quality },
"tags": self._tags }