Re: testing client-server sockets

2008-04-18 Thread Astan Chee
Wierd. It works now. I must've changed something. Oh well, thanks anyway. David Harrison wrote: On 18/04/2008, Astan Chee <[EMAIL PROTECTED]> wrote: Server code: import os, sys, socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = '' port = 5602 s.bind((host,port)) try

Re: testing client-server sockets

2008-04-18 Thread David Harrison
On 18/04/2008, Astan Chee <[EMAIL PROTECTED]> wrote: > Server code: > > import os, sys, socket > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > host = '' > port = 5602 > s.bind((host,port)) > try: > s.listen(1) > while 1: > conn, addr = s.accept() > print

Re: testing client-server sockets

2008-04-18 Thread Astan Chee
Server code: import os, sys, socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = '' port = 5602 s.bind((host,port)) try: s.listen(1) while 1: conn, addr = s.accept() print 'client is at', addr data = conn.recv(100) data = data * 10 z =

Re: testing client-server sockets

2008-04-18 Thread David Harrison
On 18/04/2008, Astan Chee <[EMAIL PROTECTED]> wrote: > Hi, > I have a client-server socket script in python. Something like this > http://ubuntuforums.org/showthread.php?t=208962 > Now the problem I have is that I want to try to connect the client to > the server on the same machine, but it giv

testing client-server sockets

2008-04-18 Thread Astan Chee
Hi, I have a client-server socket script in python. Something like this http://ubuntuforums.org/showthread.php?t=208962 Now the problem I have is that I want to try to connect the client to the server on the same machine, but it gives me a 'port already in use' error. I just want the client to c