Permalink
Browse files

Bugfix - don't wait when sending data.

  • Loading branch information...
1 parent 122cfd2 commit ad0b83825fe65fd463ee480995ad63d9966853b1 @gestiweb gestiweb committed Apr 28, 2011
Showing with 10 additions and 7 deletions.
  1. +10 −7 bjsonrpc/connection.py
View
@@ -708,20 +708,23 @@ def settimeout(self, operation, timeout):
self._sck.settimeout(timeout)
-
+
def write(self, data, timeout = None):
+ th1 = threading.Thread(target=self.write_now, kwargs={"data":data,"timeout":timeout})
+ th1.start()
+
+ def write_now(self, data, timeout = None):
"""
Standard function to write to the socket
which by default points to write_line
"""
+ #self.scklock.acquire()
self.settimeout("write", timeout)
- self.scklock.acquire()
ret = None
- try:
- ret = self.write_line(data)
- finally:
- self.scklock.release()
-
+ #try:
+ ret = self.write_line(data)
+ #finally:
+ # self.scklock.release()
return ret
def read(self, timeout = None):

0 comments on commit ad0b838

Please sign in to comment.