/// <summary> /// 终止服务并释放资源 /// </summary> public override void Destroy() { Stop(); if (pAgent != IntPtr.Zero) { HPSocketSdk.Destroy_HP_TcpPackAgent(pAgent); pAgent = IntPtr.Zero; } if (pListener != IntPtr.Zero) { HPSocketSdk.Destroy_HP_TcpAgentListener(pListener); pListener = IntPtr.Zero; } IsCreate = false; }