SetCookies() public method

public SetCookies ( WebSocketSharp.Net.CookieCollection cookies ) : void
cookies WebSocketSharp.Net.CookieCollection
return void
Exemplo n.º 1
0
        // As server
        private HandshakeResponse createHandshakeResponse()
        {
            var res = new HandshakeResponse ();
              res.AddHeader ("Sec-WebSocket-Accept", createResponseKey ());

              if (_protocol.Length > 0)
            res.AddHeader ("Sec-WebSocket-Protocol", _protocol);

              if (_extensions.Length > 0)
            res.AddHeader ("Sec-WebSocket-Extensions", _extensions);

              if (_cookies.Count > 0)
            res.SetCookies (_cookies);

              return res;
        }
Exemplo n.º 2
0
        // As server
        private HandshakeResponse createHandshakeResponse()
        {
            var res = new HandshakeResponse (HttpStatusCode.SwitchingProtocols);
              var headers = res.Headers;

              headers ["Sec-WebSocket-Accept"] = CreateResponseKey (_base64Key);

              if (_protocol != null)
            headers ["Sec-WebSocket-Protocol"] = _protocol;

              if (_extensions != null)
            headers ["Sec-WebSocket-Extensions"] = _extensions;

              if (_cookies.Count > 0)
            res.SetCookies (_cookies);

              return res;
        }