protected Boolean TryCreateReceiveBuffer(out WebSocketReceiveBuffer buffer) { lock ( m_lock ) { if (State >= WebSocketState.Closed) { buffer = default; return(false); } if (IsCompressionEnabled()) { if (m_inflater == null) { m_inflater = new ZLibInflater(); m_inflater.AddRef(); Closed.ContinueWith(x => m_inflater.Release()); } else { m_inflater.AddRef(); } } } buffer = new WebSocketReceiveBuffer(m_inflater); return(true); }
internal WebSocketReceiveBuffer(ZLibInflater inflater) { m_inflater = inflater; Type = WebSocketMessageType.Text; }