milop

milop
- Name: [not set]
- Favorite Languages: [not set]
- Website: [not set]
- Location: [not set]
- About Me: [not set]
-
C# Tutorial - Simple Threaded TCP Server
03/18/2010 - 13:07
Ok, I see what you had in mind.
My server needs only to exchange info with a single client and then end. The threads that I shell out are cleaned up once the socket is closed, usually in about 30 seconds or so (I also close the stream object, you don't).
I guess because I'm not keeping them in some container there is no reference to it and the GC cleans it up. Would you agree?
Thanks again,
Mike -
C# Tutorial - Simple Threaded TCP Server
03/18/2010 - 12:08
Understood. What do you mean by "send it something" and when would you know that it's ok to send it something? I mean, what mechanism would you use to determine that the client object is no longer exchanging information and is in a state for you to send it something?
-
C# Tutorial - Simple Threaded TCP Server
03/18/2010 - 05:50
Thanks. After a bit of a brush up on sockets I confirmed this with NETSTAT.
I have one more question, if you don't mind. In your article you stated that you like to keep the "client" object around. How would you know that a "client" object can be reused? The "Connected" property?
Thanks again.
-
C# Tutorial - Simple Threaded TCP Server
03/16/2010 - 06:10
If each thread is communicating through the same port, how is it that one client doesn't get the data intended for a different client? Does the NetworkStream object create the "isolation"?
Recent Comments