public void DisConnection()
{
m_IPAddrMsg.m_IsNeedClose = false;
__DestoryNetWorkThread();
if (m_Socket != null)
{
try
{
m_IPAddrMsg.m_IsNeedCallDisConnect = true;
m_Socket.Shutdown(SocketShutdown.Both);
m_Socket.Close();
Debug.Log("NetTCPSocketConnect::DisConnection - close socket");
}
catch (System.Exception excep)
{
Debug.LogError("NetTCPSocketConnect::DisConnection - closet socket eror:" + excep.ToString());
}
}
m_Socket = null;
m_IPAddrMsg.m_IsConnect = false;
if (null != m_NetStateListener)
{
m_NetStateListener.del_OnDisconnect(m_nSocketID);
}
return;
}
//------------------------------------------------------------------------- /// <summary> /// 重连当前连接 /// </summary> public void ReConnect() { CNetTCPSocketConnect c = null; if (m_TCPConnects.TryGetValue(m_currentConnectedSID, out c)) { c.DisConnection(); c.Reconnect(); } }