timskipper
New member
I’m new to remoting in VB.NET and have been thinking of how to implement an idea that may not even be possible.
I have a class that establishes a TCP connection with a remote server and sends messages back and forth. This works a treat, except that the remote server discourages you from continually opening and closing connections by enforcing a 3 second delay post connect before it will begin communication.
The idea is that instead you open a connection at the start of your day, communicate as necessary, and then close it again later on.
What I would like to do is this;
1. Have a windows service that opens the TCP connection when it’s started, and closes it when it’s stopped.
2. Have a remoteable version of my class which processes the communication between the client and the server, hosted by the windows service and which uses the TCP connection created by the windows service.
3. Have a client which calls the class, through it’s windows service host, multiple times without having to open and close a TCP connection each time.
The issue as far as I see it is, how do you pass the TcpClient reference between the windows service and each instance of the class created by the client?
Is this even possible?
I have a class that establishes a TCP connection with a remote server and sends messages back and forth. This works a treat, except that the remote server discourages you from continually opening and closing connections by enforcing a 3 second delay post connect before it will begin communication.
The idea is that instead you open a connection at the start of your day, communicate as necessary, and then close it again later on.
What I would like to do is this;
1. Have a windows service that opens the TCP connection when it’s started, and closes it when it’s stopped.
2. Have a remoteable version of my class which processes the communication between the client and the server, hosted by the windows service and which uses the TCP connection created by the windows service.
3. Have a client which calls the class, through it’s windows service host, multiple times without having to open and close a TCP connection each time.
The issue as far as I see it is, how do you pass the TcpClient reference between the windows service and each instance of the class created by the client?
Is this even possible?