10-27-07 06:32 AM
In article <1193405730.288499.190460@19g2000hsx.googlegroups.com>,
kasthurirangan.balaji@gmail.com wrote:
> I intend to write a server in this fashion.
>
> 1)Create a socket, bind it and listen on it.
> 2)Fork 'n' number of childs and pass the socket descriptor as
> argument.
> 3)Each would would then do an accept on that socket descriptor.
> 4)when a request comes to any of the childs, the child would create a
> thread to handle it.
>
> This is just the outline. Is this a correct/good design and in right
> direction? Can i replace step 1 of this with openSSL create call for
> adding security?
>
> Thanks,
> Balaji.
If you're going to create new threads when the requests come in, why
fork N processes in the first place?
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
[ Post a follow-up to this message ]
|