Iam having a question with respect to ACE. This is regarding Threads. Is
thread per connection being supported in ACE. This is with respect to
concurrent servers.
1. One main thread listens on 1 port.
2. When ever a new connection request arrives from a client, spawn a
seperate thread to start receiving messages from the same.
3. Server goes back to the listen mode.
Thanks in advance...
Raghu
> Iam having a question with respect to ACE. This is regarding Threads. Is
> thread per connection being supported in ACE. This is with respect to
> concurrent servers.
Yes. We do that all the time.
> 1. One main thread listens on 1 port.
> 2. When ever a new connection request arrives from a client, spawn a
> seperate thread to start receiving messages from the same.
> 3. Server goes back to the listen mode.
Right. Please take a look at
$ACE_ROOT/tests/Process_Strategy_Test.cpp.
which demonstrates how to use the ACE_Strategy_Acceptor with different
concurrency strategies.
Thanks,
Nanbor
>>Iam having a question with respect to ACE. This is regarding Threads. Is
>>thread per connection being supported in ACE.
BTW, thanks to James Johnson, there's even an online tutorial that
illustrates how to use ACE to implement thread-per-connection. Please
see
http://www.cs.wustl.edu/~schmidt/ACE_wrappers/docs/tutorials/006/page01.html
Thanks,
Doug
--
Dr. Douglas C. Schmidt, Associate Professor
Department of Computer Science, Washington University
St. Louis, MO 63130. Work #: (314) 935-4215; FAX #: (314) 935-7302
sch...@cs.wustl.edu, www.cs.wustl.edu/~schmidt/
>Iam having a question with respect to ACE. This is regarding Threads. Is
>thread per connection being supported in ACE.
Yes, indeed. Both ACE and TAO support this concurrency model.
>This is with respect to
>concurrent servers.
>
>1. One main thread listens on 1 port.
>2. When ever a new connection request arrives from a client, spawn a
>seperate thread to start receiving messages from the same.
>3. Server goes back to the listen mode.
It's trivial to do this -- all you need to do is activate() your
Svc_Handler. Check out
$ACE_ROOT/netsvcs/lib/Server_Logging_Handler_T.cpp
for an example of how to do this.
Take care,