agent
Feb 25th, 2001, 06:40 PM
I'm trying to write a multi-user/multi-room/multi-client chat server. To do this, I thought I'd start by writing a basic echo server. The way an echo server works is when a client sends data to the server, the server sends the data to all of the other servers (including the one that sent the data in the first place).
To handle multiple clients, I came up with a method of useing an mdi form to represent the server and a child form to represent each client.
When data arrives, the connection form sends the data to the interpreter class (via the interpret method) where the data is processed.
With the echo server, I decided to use the forms collection to broadcast the data sent in by any client. Unfortunatly, only one client can recieve the outgoing data.
-----
To reproduce this problem, start the server, load Telnet twice (included with win98 (Start|Run...|'Telnet'|Enter)), connect to the server with both instances of Telnet (Connect|Remote System...|Server=localhost, port=1001), and type some text.
If the server worked right, whatever you typed in one telnet would show up in both.
Please help me get it to work that way.
To handle multiple clients, I came up with a method of useing an mdi form to represent the server and a child form to represent each client.
When data arrives, the connection form sends the data to the interpreter class (via the interpret method) where the data is processed.
With the echo server, I decided to use the forms collection to broadcast the data sent in by any client. Unfortunatly, only one client can recieve the outgoing data.
-----
To reproduce this problem, start the server, load Telnet twice (included with win98 (Start|Run...|'Telnet'|Enter)), connect to the server with both instances of Telnet (Connect|Remote System...|Server=localhost, port=1001), and type some text.
If the server worked right, whatever you typed in one telnet would show up in both.
Please help me get it to work that way.