Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authoramartin <olpc@xo-05-28-21.localdomain>2007-12-27 11:17:05 (GMT)
committer amartin <olpc@xo-05-28-21.localdomain>2007-12-27 11:17:05 (GMT)
commit2c4b152bd5dc6d9591a09ada861ec6c39410adac (patch)
tree1415a7dc2ba7e54e0625102ff0937a26940059f8 /common
parent32a03b1c90a0df81f97104a671dddaa137b634af (diff)
network
Diffstat (limited to 'common')
-rw-r--r--common/Util/Network.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/common/Util/Network.py b/common/Util/Network.py
index 992f570..79fbab5 100644
--- a/common/Util/Network.py
+++ b/common/Util/Network.py
@@ -22,7 +22,7 @@ import gtk
import gobject
import common.Config as Config
-PORT = 24420
+PORT = 24460
LISTENER_PORT = PORT-1
WAIT_PORT = PORT-2
@@ -80,7 +80,9 @@ class Listener( threading.Thread ):
def run(self):
while 1: # rely on the owner to kill us when necessary
try:
- inputReady, outputReady, exceptReady = select.select( self.inputSockets, self.outputSockets, self.exceptSockets )
+ inputReady, outputReady, exceptReady = select.select( self.inputSockets, self.outputSockets, self.exceptSockets, 0.5 )
+ if not len( inputReady ): # timeout
+ continue
if self.listenerSocket in inputReady:
data, s = self.listenerSocket.recvfrom(MAX_SIZE)
if data == "REFRESH":
@@ -91,7 +93,7 @@ class Listener( threading.Thread ):
else:
break # exit thread
gtk.gdk.threads_enter()
- self.owner._processSockets( inputReady, outputReady, exceptReady )
+ self.owner._processSockets( inputReady )
gtk.gdk.threads_leave()
except socket.error, (value, message):
print "Listener:: socket error: " + message
@@ -162,6 +164,7 @@ class Network:
if self.listener:
self.listenerSocket.sendto( "EXIT", ("localhost",LISTENER_PORT) )
time.sleep(0.01) # get off the cpu so the listerer thread has a chance to clear.. IS THERE A BETTER WAY TO DO THIS?
+ self.listener = None
if self.mode == MD_HOST:
for s in self.inputSockets:
@@ -463,7 +466,7 @@ class Network:
#-----------------------------------------------------------------------
# Message Handlers
- def _processSockets( self, inputReady, outputReady, exceptReady ):
+ def _processSockets( self, inputReady ):
self._fromListener = True