I have a program that listens on a tcp port for another application to connect to it and send data to it. and it stays connected until the other application closes.
I'm using a threaded tcp listener to do this. I had some user of my program report that from time to time the other program shuts down and restarts itself to reset settings that have changed. When the program does this then my program loses the connection and thinks its lost connection so it shuts everything down.
When I asked the developer of the other program about this he told me that I am single threaded and I need to use a multi-threaded asynchronous TCP Listener. He says this way when his application drops and reopens that my tcp listener will just think its another client trying to connect.
I have never heard of a multi-threaded asynchronous TCP Listener. I have googled and find some things on an asynchronous TCP Listener but none show how it would work in a multi-threaded application. I don't want to use any outside dll file I would like the tcp listener to run is the same form like my current tcp listener does.
Can someone point me in the right direction or send me to a site where I can look at some code to figure out how to accomplish this..
Thanks in advance..
Rick
I'm using a threaded tcp listener to do this. I had some user of my program report that from time to time the other program shuts down and restarts itself to reset settings that have changed. When the program does this then my program loses the connection and thinks its lost connection so it shuts everything down.
When I asked the developer of the other program about this he told me that I am single threaded and I need to use a multi-threaded asynchronous TCP Listener. He says this way when his application drops and reopens that my tcp listener will just think its another client trying to connect.
I have never heard of a multi-threaded asynchronous TCP Listener. I have googled and find some things on an asynchronous TCP Listener but none show how it would work in a multi-threaded application. I don't want to use any outside dll file I would like the tcp listener to run is the same form like my current tcp listener does.
Can someone point me in the right direction or send me to a site where I can look at some code to figure out how to accomplish this..
Thanks in advance..
Rick