Are you really planning on implementing a telnetd in Java? I mean, you can - but that's not what you want a chat-server to do, really.
Most of the time, what you're really asking about is how to use Sockets in a multi-threaded environment. Or, for something that scales better go read about the java.nio package.
Grant
actually this is what i need to do and thats why i posted a query for knowing how to connect to telnet
Implement a simple multithreaded chat server using the TCP socket libraries on Unix/Linux.
Server specifications:
The server takes a single command-line argument that specifies the port number the server is using, i.e. chatserver 5555 . The server should be able to handle new connections and also handle data from a client. The chat server should:
刋maintain a dynamic list of connected clients and broadcast each message it receives to all the connected clients (except the sender itself).
刋Prompt the user to enter a name and append that name to each message sent from that user.
刋Inform all connected clients of a new client that has logged in and also of a client that has logged out (by sending a keyword such as ¨BYE〃 or ¨EXIT〃).
刋Respond to a clientˇs request for a list of connected clients. The client will issue a command LIST and the server should reply to that client with a list of connected clients.
Client specification:
A user will simply use ¨telnet〃 to access the chat server.
OK - so your project is entirely server-side socket connections and threading. The "client requirement" is simply that you do not have to write a client - use telnet, because it's whole job is knowing how to open socket connections to a server:port and send text commands down the pipe.
Grant
?
No, you don't need to "monitor" telnet - it's just the thing you use to talk to the server, just like AIM is the app you use to talk to to AOL's IM server.
You write your server, and start it up. It starts listening for incoming traffic on port 5555.
You run telnet: $ telnet mymachine 5555
Your server wakes up and spins off a thread to handle the connection. That worker writes "Login:" to the socket.
Running telnet, you see "Login:", and you enter a uid and hit enter.
Server reads the incoming uid, writes "Password:" to the socket.
At telnet, you see "Password:", and you enter one.
Server reads password, validates the uid/pwd pair, and writes "Welcome!" to the socket.
At telnet, you see "Welcome!".
At this point, you know that your client/server communication works.
Does that help any?
Grant