Esempio n. 1
0
		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;
		}
Esempio n. 2
0
 public void Flush()
 {
     source.Flush();
 }