I am writing a Socket-based server on a VB.Net 2003 Socket program. I have worked this a few different ways. My first version is based on the code <a href="
http://www.eggheadcafe.com/articles/20020323.asp">
here</a> and a second version from <a href="
http://msdn2.microsoft.com/en-us/library/fx6588te.aspx">here
</a>. Both of which work fine to communicate between processes on a single machine or two machines on a single network.
The problem comes in when I go to deploy this to the production server(Windows Server 2003, Standard Edition). My client (a third-party vendor) can connect and send me their message. I read it on the socket and format my response. However, I get two different kinds of failures. In the Bromberg single-threaded example, I get an IOException trying to send saying "Unable to write to the socket" or "Unable to write to the stream" depending on which object I use. I googled these, and the error usually reported claims that "connection was forcibly closed". I do not receive that additional text in my errors. I check my connection with netstat -b and it is still established. I put code in to check that the stream status is CanWrite on the line immediately before the myStream.Write statement. As I said, it works with a local client, though.
Using the Microsoft example, I get no exception with the multi-threaded server. I put some logging messages in just before and after the send. These are hit fine. My vendor says that he cannot see the message. I have tried adding myStream.Flush, but no help.
My network admin says that the router is properly configured. I can ping the client's machine from my server machine. I definitely open the socket and receive their message. What else should I check to troubleshoot the problem?
Start Free Trial