Hi everyone,

While trying to develop a multithreaded server for my mobile I ran into the following seemingly impossible problem:

There is a thread accepting incoming requests:


RSocket * socket;
ps->channels->servBind(socket, ...);

while( *(ps->active) ) {
error = ps->channels->servAccept(socket, ...);
if (!error) {
error = thread.Create(..., socket);
if(error == KErrNone)
thread.Resume(); //start the new thread


When an incoming request is accepted I want to create a new thread to handle the request and keep the other waiting for new requests. This scenario however seems impossible because I cannot pass a R-class object as a parameter to a thread function.
But my handler thread cannot handle the request without the socket that has been accepted. So this seems a dead end.

Does anyone knows a solution to this?
(Preferably not with active objects though as I would have to change a lot of already existing functionality).

thnx in advance