/// <summary> /// Disconnects the client from server. /// </summary> public void Close() { WebSocketPacket pingPacket = new WebSocketRawPacket(WebSocketFrameType.CLOSE, "Bye"); pingPacket.SetEndFrame(true); SendInternal(WebSocketProtocolAbstraction.RawToProtocolPacket(pingPacket)); }
private void SendPacketText(string aUTF8String, int aFragmentSize) { WebSocketPacket lPacket = new WebSocketRawPacket(WebSocketFrameType.TEXT, aUTF8String); lPacket.SetEndFrame(true); SendInternal(WebSocketProtocolAbstraction.RawToProtocolPacket(lPacket)); }
/// <summary> /// Pings the server. /// </summary> public void Ping() { WebSocketPacket pingPacket = new WebSocketRawPacket(WebSocketFrameType.PING, "Hello"); pingPacket.SetEndFrame(true); SendInternal(WebSocketProtocolAbstraction.RawToProtocolPacket(pingPacket)); }