[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

Telnet Server

I'd like to know how I can make a Multi user CHAT telnet server ( LINUX ). I know kinda how the commands socket(), accept(), bind(), and listen() work, but how would i be able to get multiple users to be able to connect at one time and send strings from one console to another. a very simple chat server would be VERY much appreciated.
0
TRM
Asked:
TRM
  • 2
  • 2
1 Solution
 
jdyerCommented:
Download the file:

http://www.foobar.co.uk/~simon/net/files/multi.c

It will get you rolling very fast. There is very little modification that needs to be made, and it is relatively well commented! There is a warning that the code is not fully functional. I compiled it and it ran the first time without modification (he's just protecting himself).

This should help alot, I hope so. If you need more info, let me know!

Regards,
  jdyer
0
 
WxWCommented:
Once your server listens to a port , accept() returns a socket AND the port is STILL listening . That means that you can accept() as many connections as you want . But you will have to figure how the information and the messages you will receive will be forwarded to all connected users .
0
 
jdyerCommented:
well WxW the OS often times limits the number of connections that can be opened. I think on most Lynix implementations it is 400 per socket. But that might be a little off.

Regards,
  jdyer
0
 
WxWCommented:
Hmmm I am not sure but since Linux has more history as a UNIX platform , it would not allow less sockets to be created than WinSock .... Anyway you may have right
0
 
TRMAuthor Commented:
Thank you all VERY much. This will help me alot.
ty
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now