I have a desktop application written in C#. It is trying to manage a socket connection and fails. The same application is successful if it is attached to the Visual Studio debugger.
How can it be debugged?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is a classic example of timing.
If it works in the debugger then it means you have to re-factor your code a bit to handle this.
Now if you are app is a server socket that receives connections from client and trying to spawn a thread for each of those connections, you might have to consider using select() to manage connections with in one thread.