Exemplo n.º 1
0
        /// <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)
Exemplo n.º 2
0
        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];
            }
        }