Exemple #1
0
        /// <summary>
        /// 释放TcpServer和TcpServerListener
        /// </summary>
        public virtual void Destroy()
        {
            Stop();

            if (pClient != IntPtr.Zero)
            {
                HPSocketSdk.Destroy_HP_TcpClient(pClient);
                pClient = IntPtr.Zero;
            }
            if (pListener != IntPtr.Zero)
            {
                HPSocketSdk.Destroy_HP_TcpClientListener(pListener);
                pListener = IntPtr.Zero;
            }

            IsCreate = false;
        }
Exemple #2
0
 private void frmClient_FormClosed(object sender, FormClosedEventArgs e)
 {
     HPSocketSdk.Destroy_HP_TcpClient(pClient);
     HPSocketSdk.Destroy_HP_TcpClientListener(pListener);
 }