/// <summary> /// Accepts a WebSocket handshake request. /// </summary> /// <param name="protocol">A <see cref="string" /> that represents the subprotocol supported on /// this WebSocket connection.</param> /// <returns> /// A <see cref="WebSocketContext" /> that represents /// the WebSocket handshake request. /// </returns> /// <exception cref="ArgumentException"><para> /// <paramref name="protocol" /> is empty. /// </para> /// </exception> /// <exception cref="InvalidOperationException">This method has already been called.</exception> #if COMPAT public WebSocketContext AcceptWebSocket(string protocol, Unosquare.Labs.EmbedIO.Log.ILog log)
public SessionInfo GetSession(Unosquare.Net.WebSocketContext context) #endif { lock (SessionsSyncLock) { if (context.CookieCollection[SessionCookieName] == null) return null; var cookieValue = context.CookieCollection[SessionCookieName].Value; return this[cookieValue]; } }