serverSocket.BeginAccept( new AsyncCallback(AcceptedCallback), serverSocket);
client.BeginConnect( ipEnd, new AsyncCallback(ConnectedCallback), client);
会连接不上,加上
public static ManualResetEvent connEvent = new ManualResetEvent(false); serverSocket.BeginAccept( new AsyncCallback(AcceptedCallback), serverSocket); connEvent.WaitOne();
client.BeginConnect( ipEnd, new AsyncCallback(ConnectedCallback), client); connEvent.WaitOne();