|
-
September 24th, 2011, 03:37 AM
#1
Client auto exit when connect with server
i've had been trying out the client server program. the client exit or crash by itself when connection establish with server. this error code 10045 being use inside the server code as the socket exception, but why the client still exit automatically?
server code:
catch (ObjectDisposedException)
{
System.Diagnostics.Debugger.Log(0, "1", "\nOnDataReceived: Socket has been closed\n");
}
catch (SocketException se)
{
if (se.ErrorCode == 10054) // Error code
{
string msg = "User no." + socketData.m_clientNumber + " Disconnected" + "\n";
AppendToRichEditControl(msg);
// Remove the reference to the worker socket of the closed client
// so that this object will get garbage collected
m_workerSocketList[socketData.m_clientNumber - 1] = null;
UpdateClientListControl();
}
else
{
MessageBox.Show(se.Message);
}
}
what can i do so client wont auto exit? modify code in client or server or both?
thanks in advance.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|