/// <summary> /// Execute connect. /// </summary> /// <param name="host"></param> /// <param name="port"></param> /// <returns></returns> public bool Connect(string host, int port) { Disconnect(); m_Socket = new Air2000.SocketConnect(); m_Socket.OnConnectCallback = OnConnected; m_Socket.OnDisconnectCallback = OnDisconnected; return(m_Socket.Connect(host, port)); }
/// <summary> /// Disconnect the socket. /// </summary> public void Disconnect() { if (m_Socket != null) { m_Socket.Close(); m_Socket = null; } }