Beispiel #1
0
        public virtual void Disconnect(bool ANotifyPeer)
        {
            try
            {
                if (ANotifyPeer)
                {
                    if (Connected())
                    {
                        DisconnectNotifyPeer();
                    }
                }
            }
            finally
            {
                if (mSocket != null)
                {
                    if (mSocket.Connected())
                    {
//            DoStatus(StatusEnum.Disconnecting);
                        mSocket.Close();
                        DoOnDisconnected();
//            DoStatus(StatusEnum.Disconnected);
                    }
                }
            }
        }
Beispiel #2
0
 public virtual bool Connected()
 {
     return
         ((Socket != null) &&
          (Socket.Connected())
         );
 }