public void Close(bool closeElementary = true) { if (closeElementary) { source.Close(); } State = WebChannelState.Closed; }
public void Close(bool closeInternal=true) { // TODO send close message byte[] message = new byte[2]; // fin bit and opcode 0x8 message[0] = 0x88; // fin bit and opcode 0x8 message[1] = 0x0; // no mask and 0 payload messageSource.SendMessage(message); messageSource.Flush(); // close connections if (initSource != null) { initSource.Close(false); initSource = null; } if (closeInternal) { messageSource.Close(); } // clear frame and fragment fragmentLength = 0; textFrame.Clear(); binaryFrame.Clear(); State = WebChannelState.Closed; }