コード例 #1
0
        /// <summary>
        /// Closes the WebSocket connection, and releases all associated resources.
        /// </summary>
        public void Close()
        {
            var msg = _readyState.CheckIfClosable();

            if (msg != null)
            {
                error(msg);

                return;
            }

            var send = _readyState == WebSocketState.Open;

            close(new PayloadData(), send, send);
        }
コード例 #2
0
ファイル: WebSocket.cs プロジェクト: yilin101/jellyfin
        /// <summary>
        /// Closes the WebSocket connection, and releases all associated resources.
        /// </summary>
        public Task CloseAsync()
        {
            var msg = _readyState.CheckIfClosable();

            if (msg != null)
            {
                error(msg);

                return(Task.CompletedTask);
            }

            var send = _readyState == WebSocketState.Open;

            return(CloseAsync(new PayloadData(), send, send));
        }