예제 #1
0
        protected override void CloseImplementation(SocketCloseCode code, string reason)
        {
            if (_socket != null)
            {
                OnTrace(XenLogLevel.Info, $"Closing connection to {Endpoint}.");

                var status = CloseStatusCode.Undefined;

                switch (code)
                {
                case SocketCloseCode.Normal:
                    status = CloseStatusCode.Normal;
                    break;

                case SocketCloseCode.Undefined:
                    status = CloseStatusCode.Undefined;
                    break;

                case SocketCloseCode.UnsupportedData:
                    status = CloseStatusCode.UnsupportedData;
                    break;
                }

                _socket.Close(status, reason);
            }
        }
예제 #2
0
 protected override void CloseImplementation(SocketCloseCode code, string reason)
 {
 }
예제 #3
0
 protected abstract void CloseImplementation(SocketCloseCode code, string reason);
예제 #4
0
 /// <summary>
 /// Close the current connection to a <see cref="DesignServer"/>
 /// </summary>
 /// <param name="code"></param>
 /// <param name="reason"></param>
 public virtual void Close(SocketCloseCode code, string reason)
 {
     CloseImplementation(code, reason);
 }