socket problem: works in visual studio, not as release
-
I am developing an application in which a connection to a server application on another computer within our network is established. I am using a System.Net.Sockets.Socket to establish the connection to said server app. Upon successfully connecting to the server app, I send a connect message with the login credentials the user provided. In response, the server app should send back a message to indicate a successful or unsuccessful login. My problem is this: when running from within the Visual Studio development, it works flawlessly. When I launch the executable directly, I do not receive the return message from the server app. Any ideas?
-
I am developing an application in which a connection to a server application on another computer within our network is established. I am using a System.Net.Sockets.Socket to establish the connection to said server app. Upon successfully connecting to the server app, I send a connect message with the login credentials the user provided. In response, the server app should send back a message to indicate a successful or unsuccessful login. My problem is this: when running from within the Visual Studio development, it works flawlessly. When I launch the executable directly, I do not receive the return message from the server app. Any ideas?
Do you log all exceptions? What are the symptoms other than "it does not work"? Maybe you gave VS a permanent green light in your firewall, and it is blocking your app outside VS? :)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
-
Do you log all exceptions? What are the symptoms other than "it does not work"? Maybe you gave VS a permanent green light in your firewall, and it is blocking your app outside VS? :)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
Luc: No firewalls are on between "here" and "there". No exceptions are being thrown. The server application is logging the receipt of the message from the client application.
-
Luc: No firewalls are on between "here" and "there". No exceptions are being thrown. The server application is logging the receipt of the message from the client application.
Odd. Did you try debug build running inside VS? release build running inside VS? debug build double-clicked in bin\debug folder? release build double-clicked in bin\release folder? the difference would be optimizations (timing difference or bugs), and error handling (VS settings influence some). Do you use time-outs? with sufficient value? and failures get logged? or is the client hanging, waiting on a reply? :)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
-
Odd. Did you try debug build running inside VS? release build running inside VS? debug build double-clicked in bin\debug folder? release build double-clicked in bin\release folder? the difference would be optimizations (timing difference or bugs), and error handling (VS settings influence some). Do you use time-outs? with sufficient value? and failures get logged? or is the client hanging, waiting on a reply? :)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
Luc: There was one point where I was missing code in a catch statement. That was the exception that was getting thrown. After I added code to handle that exception, I discovered that the problem was stemming from a difference in the amount of data included in the message sent from my Test tier versus my local tier. Due to this size difference, a flaw in my received handler was being tripped. Fixed my code and everything works as expected. Thanks for your question about exceptions. If forced me to go back and check all of my catch statements. Tim
-
Luc: There was one point where I was missing code in a catch statement. That was the exception that was getting thrown. After I added code to handle that exception, I discovered that the problem was stemming from a difference in the amount of data included in the message sent from my Test tier versus my local tier. Due to this size difference, a flaw in my received handler was being tripped. Fixed my code and everything works as expected. Thanks for your question about exceptions. If forced me to go back and check all of my catch statements. Tim
yep. catching and somehow showing all exceptions is a powerful technique. whenever I see an empty catch statement (and that is quite frequently around here, some people think it is wise to skip or postpone error handling), I make sure the perpetrator will not forget about it any time soon ... :)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!