Exemplo n.º 1
0
 private bool HandleInfo(RequestEventArgs e)
 {
     e.Response.Status = HttpStatusCode.OK;
     var verb = new InfoVerb();
     verb.Node = model.LocalNode;
     NetworkRequest result = verb.CreateRequest();
     byte[] data = Encoding.UTF8.GetBytes(result.Data);
     var generator = new ResponseWriter();
     e.Response.ContentLength.Value = data.Length;
     generator.SendHeaders(e.Context, e.Response);
     e.Context.Stream.Write(data, 0, data.Length);
     e.Context.Stream.Flush();
     return true;
 }
Exemplo n.º 2
0
 private bool HandleClient(NetworkRequest r, RequestEventArgs e)
 {
     var verb = new InfoVerb();
     verb.Node = serverNode;
     SendResponse(e, Encoding.UTF8.GetBytes(verb.CreateRequest().Data));
     return true;
 }