Solved

Telnet Server

Posted on 1998-08-18
5
233 Views
Last Modified: 2010-04-01
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
Comment
Question by:TRM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
jdyer earned 50 total points
ID: 1170650
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
 
LVL 6

Expert Comment

by:WxW
ID: 1170651
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
 
LVL 1

Expert Comment

by:jdyer
ID: 1170652
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
 
LVL 6

Expert Comment

by:WxW
ID: 1170653
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
 

Author Comment

by:TRM
ID: 1170654
Thank you all VERY much. This will help me alot.
ty
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question