Solved

Telnet Server

Posted on 1998-08-18
5
227 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
  • 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now