| | |
| | | public class ClientSocketController
|
| | | {
|
| | | Socket m_Socket;
|
| | | public Socket socket {
|
| | | public Socket socket
|
| | | {
|
| | | get { return m_Socket; }
|
| | | }
|
| | |
|
| | |
| | | /// </summary>
|
| | | public void CloseConnect()
|
| | | {
|
| | | isStopTreading = true;
|
| | | if (m_packageThread != null)
|
| | | try
|
| | | {
|
| | | m_packageThread.Abort();
|
| | | isStopTreading = true;
|
| | | if (m_packageThread != null)
|
| | | {
|
| | | m_packageThread.Abort();
|
| | | }
|
| | | }
|
| | | catch (System.Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | |
|
| | | if (m_Socket != null && m_Socket.Connected)
|
| | | try
|
| | | {
|
| | | m_Socket.Shutdown(SocketShutdown.Both);
|
| | | m_Socket.Close();
|
| | | if (m_Socket != null && m_Socket.Connected)
|
| | | {
|
| | | m_Socket.Shutdown(SocketShutdown.Both);
|
| | | m_Socket.Close();
|
| | | }
|
| | |
|
| | | }
|
| | | catch (System.Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | |
|
| | | sendQueue.Clear();
|
| | |
| | | Array.Copy(vMsgBodyLength, 0, vTotal, 2, vMsgBodyLength.Length);
|
| | | Array.Copy(vBytes, 0, vTotal, 6, vBytes.Length);
|
| | |
|
| | | SendBytes(vBytes);
|
| | | SendBytes(vTotal);
|
| | | }
|
| | |
|
| | | /// <summary>
|