示例#1
0
        /// <summary>
        /// Disconnects the client from server.
        /// </summary>
        public void Close()
        {
            WebSocketPacket pingPacket = new WebSocketRawPacket(WebSocketFrameType.CLOSE, "Bye");

            pingPacket.SetEndFrame(true);
            SendInternal(WebSocketProtocolAbstraction.RawToProtocolPacket(pingPacket));
        }
示例#2
0
        private void SendPacketText(string aUTF8String, int aFragmentSize)
        {
            WebSocketPacket lPacket = new WebSocketRawPacket(WebSocketFrameType.TEXT, aUTF8String);

            lPacket.SetEndFrame(true);
            SendInternal(WebSocketProtocolAbstraction.RawToProtocolPacket(lPacket));
        }
示例#3
0
        /// <summary>
        /// Pings the server.
        /// </summary>
        public void Ping()
        {
            WebSocketPacket pingPacket = new WebSocketRawPacket(WebSocketFrameType.PING, "Hello");

            pingPacket.SetEndFrame(true);
            SendInternal(WebSocketProtocolAbstraction.RawToProtocolPacket(pingPacket));
        }