Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tcp server 1

Status
Not open for further replies.

MiMoore

Programmer
Aug 25, 2005
12
IE
Hello,

I'm in the process of reading up on tcp.
i hav a project working in unix/C programming environment and I want to design a multi client tcp server.
Basically I would like to know if there is existing design pattern in C/unix domain.
Here is some more information on the problem.
Since I'm new to all this, really I would like your advice and input as to what I should consider for scalable efficient solution.
The server would need to support multiple connections from clients applications ( maybe a couple 100 of apps)
The clients could be http and other type applications.
Considering that different applications needs to be supported should I consider using multiple TCP listening ports? Would this be useful afterwards when determining where the data should be forwarded to to handle further app specific processing (example receive data on tcp socket X so so route to another local app for http data processing)
Or could I have just one socket and let all the connections and data through this single socket? With this approach, would the server need advanced intelligence to determine that type of data received from the different client apps?
What is the best way to correlate data from socket from HTTP client app to a local http handler.

What is the most efficient way to read data from socket. Maybe I could use timer based approach or I have also seen software interrupt SIGIO where a signal handler could be provided.

Should I consider some multi threading for the server to handle each connection or forking.

Any thoughts/inputs on any design patterns alrready out there and/or best approach would be appreciated.

thanks.
 
seems to me like your question really belongs in a programming forum.

Good luck,
 
Huh? Is the purpose of the server to manage ports? If so, why not just use a firewall or a router?
I have never heard of a "tcp server" myself...

Burt
 
Probably because it's a project, not a business plan.

"We can categorically state that we have not released man-eating badgers into the area" - Major Mike Shearer
 
Hi,

it is just a project.

It is the concept of the "TCP server/handler" I'm referring to.
It is not necessarily a hardware device.
It would be a software program to sit and listen for client connections, present different data to relevant local applications and forward any responses also.
eg, HTTP web app sends data over TCP/IP to known post on machine X running the tcpserver and listening to port X.
it would receive the data and present it to another local application to process and format reply for return path also.

And I was looking at having different ports for different protocols..

sorry if doesmt make sense as I'm just learning it my self.
I presume there would be stuff like this already done so was looking for pointers on design and so on.

thanks.
 
It's a good way to learn, that's for sure. It might be worth your time making a post in the programming forums?

"We can categorically state that we have not released man-eating badgers into the area" - Major Mike Shearer
 
yep, I posted there but no replies :-(

I can struggle on. just would be nice to start out on right foot. thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top