[Edu-sig] writing an chat-server

A[r]TA arta@x-stream.nl
Sun, 9 Apr 2000 18:27:40 +0200


I want to write a simple chat-server on my pc so my friends can login and
chat. :)
But I've some problems.
1) How do I get multiple connections?
2) How do I handle the multiple requests and sends of data?
A complete solution isn't needed, but if someone could help me a bit,
I would be glad. :)

This is what I use:

from socket import *
HOST = ''
PORT = 5007
s = socket(AF_INET, SOCK_STREAM)
s.bind(HOST, PORT)
s.listen(1)
conn, addr = s.accept()
data = conn.recv(1024)

After that the server is sending some things to the client.
But then I've got to get an loop with is going on en on till
someone types a special comman and the server resets the
connection.

Thnx, A[r]TA

-Sorry for my poor English! A real Flying Dutchman. :-)