コード例 #1
0
        private bool send(Fin fin, Opcode opcode, Mask mask, byte[] data, bool compressed)
        {
            lock (_forConn)
            {
                if (_readyState != WebSocketState.Open)
                {
                    return(false);
                }

                return(writeBytes(
                           WebSocketFrame.CreateWebSocketFrame(fin, opcode, mask, data, compressed).ToByteArray()));
            }
        }
コード例 #2
0
ファイル: WebSocket.cs プロジェクト: yilin101/jellyfin
        private Task <bool> SendAsync(Fin fin, Opcode opcode, Mask mask, byte[] data, bool compressed)
        {
            lock (_forConn)
            {
                if (_readyState != WebSocketState.Open)
                {
                    return(Task.FromResult(false));
                }

                return(WriteBytesAsync(
                           WebSocketFrame.CreateWebSocketFrame(fin, opcode, mask, data, compressed).ToByteArray()));
            }
        }