I have a huge issue. Working on EMX VS2012 MF 4.2
Have a client application that is supposed to connect to a given server ip and port.
When server is listening, all is fine, but if server is unreachable/off the socket.connect call hangs forever, even when server starts listening after the call to connect is done.
I run the client code in separate thread:
// Create socket and connect to the server's IP address and port Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.Connect(ep); //Never returns if cable is disconnected or server away!!! return socket;
It does not throw any exceptions or anything, just hangs.
I can see two approaches here:
- Hardware reboot using watchdog, dirty
- Kill the thread and start again, have not tried this but can see issues with memory etc in the end if this is an underlying bug/issue.
I have many threads that listen on my device and they all work without any problem:
- Remote flash
I only have this issue when I try to connect out from my device. This is basic socket TCP/IP function and it me that this would be an issue!!
Hope anyone can help me out, this is a very important aspect of my product and need to work…