[Last Call] Learn how to a build a cloud-first strategyRegister Now


C++ threaded TCP Server

Posted on 2006-04-14
Medium Priority
Last Modified: 2006-11-18

i want to write a multithreaded TCP (Socket) Server on Linux...

Can someone advise me how to write this? or provide an example

-Threaded Connection

The Main Thread should have the socket listener and if a client is connected then this should be handled by a separate thread...

Thanks Woigl
Question by:woigl
  • 2

Accepted Solution

B1-66ER earned 750 total points
ID: 16455962
LVL 86

Expert Comment

ID: 16456052
http://linux.derkeiler.com/Mailing-Lists/RedHat/2004-06/0558.html ("Multithreaded HTTP Server for Linux built up by the pool of threads utilizing select() system call.") might be interesting for you also (the article was formerly available from http://www.linuxgazette.com/node/10175 - but that onw is dead now)
LVL 86

Expert Comment

ID: 16456055
Oh, as for the threading part - see also http://www.llnl.gov/computing/tutorials/pthreads/ ("POSIX Threads Programming")

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.
Suggested Courses

830 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