View Single Post
Old 11-07-2004, 09:46 PM   #5 (permalink)
Artsemis
Insane
 
Location: West Virginia
Code:
# client
import socket
import thread

getHOST = (raw_input('Enter the Host: '))
HOST = getHOST
PORT = 150        # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
NAME = raw_input('Enter your name: ')
s.send(NAME)
data = s.recv(1024)
print data

def checkMessage():
    while 1:
        try:
            data = s.recv(1024)
            print data
        except:
            return None
    
thread.start_new_thread(checkMessage,())

while True:
    MSG = raw_input('>> ')
    s.send(MSG)
    #if MSG == "quit": break
s.close()
Made -alot- of progress! The ONLY issue I can see as of right now is that this thread isn't working that constantly reads for incoming data - any help is greatly appreciated.
__________________

- Artsemis
~~~~~~~~~~~~~~~~~~~~
There are two keys to being the best:
1.) Never tell everything you know
Artsemis is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62