29 using System.Collections.Generic;
32 using System.Net.Sockets;
35 using OpenSim.Framework;
37 namespace OpenSim.Tests.Common
44 public string ResponseBody
46 get {
return Encoding.UTF8.GetString(m_responseStream.ToArray()); }
49 public Byte[] ResponseBodyBytes
51 get{
return m_responseStream.ToArray(); }
54 private MemoryStream m_responseStream =
new MemoryStream();
56 public bool IsSecured {
get; set; }
60 get {
return IsSecured; }
61 set { IsSecured = value; }
74 public void Respond(
string httpVersion, HttpStatusCode statusCode,
string reason,
string body) {Console.WriteLine(
"x");}
75 public void Respond(
string httpVersion, HttpStatusCode statusCode,
string reason) {Console.WriteLine(
"xx");}
76 public void Respond(
string body) { Console.WriteLine(
"xxx");}
78 public void Send(byte[] buffer)
84 public void Send(byte[] buffer,
int offset,
int size)
92 m_responseStream.Write(buffer, offset, size);
95 public void Respond(
string httpVersion, HttpStatusCode statusCode,
string reason,
string body,
string contentType) {Console.WriteLine(
"xxxxxx");}
97 public bool EndWhenDone {
get {
return false;} set {
return;}}
101 return new HTTPNetworkContext();
104 public event EventHandler<DisconnectedEventArgs> Disconnected = delegate { };
108 public event EventHandler<RequestEventArgs> RequestReceived = delegate { };
void Respond(string body)
void Respond(string httpVersion, HttpStatusCode statusCode, string reason, string body)
void Send(byte[] buffer, int offset, int size)
void Respond(string httpVersion, HttpStatusCode statusCode, string reason, string body, string contentType)
HTTPNetworkContext GiveMeTheNetworkStreamIKnowWhatImDoing()
void Disconnect(SocketError error)
TestHttpClientContext(bool secured)
void Respond(string httpVersion, HttpStatusCode statusCode, string reason)