Jan-Heiner Dreschhoff
unread,Jun 16, 2009, 9:43:55 AM6/16/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wxPytho...@googlegroups.com
hi everyone,
i am trying to write a small chat, to get to know mutlithreading and sockets, but i keep getting this exception, and i have no idea how to deal with it.
can somebody help me out? the function that is giving me trouble is below
def listen():
global s
global lock
global frm
data = ""
while True:
data = s.recv(1024)
lock.acquire()
frm.output.AppendText("server: "+data +"\n")
frm.output.Refresh()
lock.release()
if frm.killflag:
thread.exit_thread()
data = s.recv(1024)
File "E:\Program files\python\lib\socket.py", line 165, in _dummy
raise error(EBADF, 'Bad file descriptor')
socket.error: [Errno 9] Bad file descriptor
Unhandled exception in thread started by <function send at 0x0000000003652898>
also: how can i write something like this without using global variables?