SF.net SVN: fclient: [377] trunk/sandbox/fcp2/iohandler.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-04-08 21:43:52
|
Revision: 377
http://fclient.svn.sourceforge.net/fclient/?rev=377&view=rev
Author: jUrner
Date: 2008-04-08 14:43:58 -0700 (Tue, 08 Apr 2008)
Log Message:
-----------
socket io was broken. fixed
Modified Paths:
--------------
trunk/sandbox/fcp2/iohandler.py
Modified: trunk/sandbox/fcp2/iohandler.py
===================================================================
--- trunk/sandbox/fcp2/iohandler.py 2008-04-08 10:12:57 UTC (rev 376)
+++ trunk/sandbox/fcp2/iohandler.py 2008-04-08 21:43:58 UTC (rev 377)
@@ -114,10 +114,10 @@
@param host: (str) host to connect to
@param port: (int) port to use
"""
-
if self.isOpen():
self.close()
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.socket.settimeout(self.Timeout)
try:
self.socket.connect((host, port))
except socket.error, details:
@@ -140,7 +140,7 @@
try:
totalSend = 0
while totalSend < len(bytes):
- n = self.io.write(bytes[totalSend: ])
+ n = self.socket.send(bytes[totalSend: ])
totalSend += n
except socket.error, details:
self.close()
@@ -228,7 +228,6 @@
self._log.info(consts.LogMessages.Connecting + ' %r' % kwargs)
self.io = self._ioPrototype()
- self.io.setTimeout(self.io.Timeout)
yield False # have to yield at least once to make unittests work (io has to be created!!)
try:
self.io.connect(**kwargs)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|