Hi, Good day to all. I am new to Python S60 and I need to code a tcp/ip server wherein the host would be the localhost. And I need to start a threads. I have this code but it seems that its not working. And also after I switched to background and go back to the application it seems that the application freezes. Please help me. Because I am planning to make this as server and create a j2me program as client that communicate within the mobile phone local. So my host should be in local host only. Thanks

server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
channel = 9002
HOST = ''
server.bind((HOST, channel))
print "Waiting for clients..."
conn, client_addr = server.accept()
fd = conn.makefile("r+")
waiting_for_msg_same_thread = e32.ao_callgate(receive_msg)
waiting_for_msg = thread.start_new_thread(waiting_for_msg_same_thread, (fd, ))
msg = appuifw.query("Send:", "text")
send_msg(fd, msg)
print "Client connected!"