Tutorial :Do i need one SocketAsyncEventArgs for each client connection made?



Question:

Please do i need a new SocketAsyncEventArgs for each client connection i make.

I'm making several client connections in a loop, filling in the UserToken for each clients state from a database.

Is there a way to reuse the SocketAsyncEventArgs and still maintain separate UserToken state for each connection.

Thanks.


Solution:1

This question is slightly old but it's still relevant in my opinion. I suggest the following links for reference:

I do recommend the codeproject link as the server implements a SocketAsyncEventArgs pool (which answers your question). Do note however that that code has issues that need to be resolved.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »