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.
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.