haanjae 7 Newbie Poster

i 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 side 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.