// JP opened flex table

Click to See Complete Forum and Search --> : Completion Port Question


Shvalb
December 8th, 2007, 03:50 AM
Hi.

I need to develop a scalable server that deals with many requests/replies.

My server should get request from clients and send replies, BUT, from time to time I need my server to initiate a request or deliver data to Clients, is this possible with Completion Port, because as far as I understand, I don't hold any kind of data-structure that contains all Sockets - so I can't write to them explicitly....Am I right?

Thanks.

MikeAThon
December 10th, 2007, 11:36 AM
... from time to time I need my server to initiate a request or deliver data to Clients, is this possible with Completion Port,
Yes, WSASend() will give you the same type of completion notification that you get from WSARecv().
... because as far as I understand, I don't hold any kind of data-structure that contains all Sockets ...
I don't understand this part. If you need a std::list of all connected clients, then write code that maintains such a list.

Mike

.pcbrainbuster
December 11th, 2007, 04:14 PM
MikeAThon: Don't you mean send() and recv()?

MikeAThon
December 11th, 2007, 09:05 PM
No. With an IOCP architecture, you call WSASend() and WSARecv(), not send() and recv().

Mike

Shvalb
December 16th, 2007, 02:02 AM
Mike:

From your answer I understand now that I can keep a list of all sockets that were created for each Client and use WSASend() and WSARecv().

another question, are you familiar with a framework called ProActor ??
it's an ACE mechansim that (as far as I know) implements CompletionPort in a very easy to use way...

Thanks

MikeAThon
December 16th, 2007, 08:15 PM
Sorry, I am not familiar with ACE or ProActor.

//JP added flex table