Ejemplo n.º 1
0
    public HandshakeResponse (HttpStatusCode code)
    {
      _code = ((int) code).ToString ();
      _reason = code.GetDescription ();

      var headers = Headers;
      headers ["Server"] = "websocket-sharp/1.0";
      if (code == HttpStatusCode.SwitchingProtocols) {
        headers ["Upgrade"] = "websocket";
        headers ["Connection"] = "Upgrade";
      }
    }
Ejemplo n.º 2
0
    internal HandshakeResponse (HttpStatusCode code)
      : base (HttpVersion.Version11, new NameValueCollection ())
    {
      _code = ((int) code).ToString ();
      _reason = code.GetDescription ();

      var headers = Headers;
      headers["Server"] = "websocket-sharp/1.0";
      if (code == HttpStatusCode.SwitchingProtocols) {
        headers["Upgrade"] = "websocket";
        headers["Connection"] = "Upgrade";
      }
    }
Ejemplo n.º 3
0
 public ResponseHandshake(HttpStatusCode code)
 {
     StatusCode = ((int)code).ToString();
       Reason     = code.GetDescription();
 }
Ejemplo n.º 4
0
 internal HttpResponse (HttpStatusCode code)
   : this (code, code.GetDescription ())
 {
 }
Ejemplo n.º 5
0
 public HTTPException(HttpStatusCode statusCode)
     : base(statusCode.GetDescription())
 {
     this.StatusCode = statusCode;
 }
Ejemplo n.º 6
0
 internal HttpResponse(HttpStatusCode code)
     : this(code, code.GetDescription())
 {
 }
Ejemplo n.º 7
0
 public ResponseHandshake(HttpStatusCode code)
 {
     StatusCode = ((int)code).ToString();
       Reason = code.GetDescription();
       AddHeader("Server", "websocket-sharp/1.0");
 }
 /// <summary>
 /// Método que responte à requisição com um erro.
 /// </summary>
 /// <param name="statusCode">Código de erro da excessão.</param>
 /// <returns>Resposta à ser devolvida ao requerente da requisição. <see cref="ActionResult"/></returns>
 protected ActionResult Error(HttpStatusCode statusCode)
 {
     return(this.Error((int)statusCode, statusCode.GetDescription()));
 }
Ejemplo n.º 9
0
 public ResponseHandshake(HttpStatusCode code)
 {
     StatusCode = ((int)code).ToString();
     Reason     = code.GetDescription();
     AddHeader("Server", "websocket-sharp/1.0");
 }
Ejemplo n.º 10
0
 public HTTPException(HttpStatusCode statusCode)
     : base(statusCode.GetDescription())
 {
     this.StatusCode = statusCode;
 }
 /// <summary>
 /// Método construtor.
 /// </summary>
 /// <param name="statusCode">Código de status da exceção.</param>
 public ServiceException(HttpStatusCode statusCode) : this(statusCode, statusCode.GetDescription())
 {
     this.StatusCode    = statusCode;
     this.StatusMessage = statusCode.GetDescription();
 }
Ejemplo n.º 12
0
 public ResponseHandshake(HttpStatusCode code)
 {
     StatusCode = ((int)code).ToString();
     Reason     = code.GetDescription();
 }