P
Paul W
I have a socket-based app running that spawns a different socket for each
user and I was looking for a way to optimize it a little better.
Currently I keep a collection of active sockets (300 - 400). My plan was to
capture the Socket IntPtr Handle when they connect and then each time I
needed to send information to that particular socket, I would call the
private Socket constructor via Reflection and use the IntPtr value as the
handle parameter. I would be maintaining a collection of 32 bit values
rather than a collection of Sockets.
My question is... do I gain anything by doing this? (1) Is reflection fast
enough in this instance. (2) Do I really get any type of performance gain
by storing the handle and not the object?
Thanks.
user and I was looking for a way to optimize it a little better.
Currently I keep a collection of active sockets (300 - 400). My plan was to
capture the Socket IntPtr Handle when they connect and then each time I
needed to send information to that particular socket, I would call the
private Socket constructor via Reflection and use the IntPtr value as the
handle parameter. I would be maintaining a collection of 32 bit values
rather than a collection of Sockets.
My question is... do I gain anything by doing this? (1) Is reflection fast
enough in this instance. (2) Do I really get any type of performance gain
by storing the handle and not the object?
Thanks.