Using Socket.BeginConnect() to connect with server in C# Winform and the IAsyncResult object was not returned error
问题 I'm doing an application which require me as a client side to connect to a server and receive data from the server. I will need to do re-connection when the connection is disconnected. Below is my code: public enum MySocketState { Disconnected = 0, Connecting, Connected } public Socket theDevSock = null; public MySocketState sockState = MySocketState.Disconnected; void DataProcess() { try { if (theDevSock == null || sockState == MySocketState.Disconnected) { Console.WriteLine("Trying to