Ejemplo n.º 1
0
        public void SendRequest(MyWebRequest request)
        {
            ResponseUri = request.RequestUri;

            request.Header = request.Method + " " + ResponseUri.PathAndQuery + " HTTP/1.0\r\n" + request.Headers;
            socket.Send(Encoding.ASCII.GetBytes(request.Header));
        }
Ejemplo n.º 2
0
        public void Connect(MyWebRequest request)
        {
            ResponseUri = request.RequestUri;

            socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            IPEndPoint remoteEP = new IPEndPoint(Dns.Resolve(ResponseUri.Host).AddressList[0], ResponseUri.Port);

            socket.Connect(remoteEP);
        }
Ejemplo n.º 3
0
 public static MyWebRequest Create(Uri uri, MyWebRequest AliveRequest, bool bKeepAlive)
 {
     if (bKeepAlive &&
         AliveRequest != null &&
         AliveRequest.response != null &&
         AliveRequest.response.KeepAlive &&
         AliveRequest.response.socket.Connected &&
         AliveRequest.RequestUri.Host == uri.Host)
     {
         AliveRequest.RequestUri = uri;
         return(AliveRequest);
     }
     return(new MyWebRequest(uri, bKeepAlive));
 }
Ejemplo n.º 4
0
 public static MyWebRequest Create(Uri uri, MyWebRequest AliveRequest, bool bKeepAlive)
 {
     if (bKeepAlive &&
         AliveRequest != null &&
         AliveRequest.response != null &&
         AliveRequest.response.KeepAlive &&
         AliveRequest.response.socket.Connected &&
         AliveRequest.RequestUri.Host == uri.Host)
     {
         AliveRequest.RequestUri = uri;
         return AliveRequest;
     }
     return new MyWebRequest(uri, bKeepAlive);
 }
Ejemplo n.º 5
0
        public void SendRequest(MyWebRequest request)
        {
            ResponseUri = request.RequestUri;

            request.Header = request.Method + " " + ResponseUri.PathAndQuery + " HTTP/1.0\r\n" + request.Headers;
            socket.Send(Encoding.ASCII.GetBytes(request.Header));
        }
Ejemplo n.º 6
0
        public void Connect(MyWebRequest request)
        {
            ResponseUri = request.RequestUri;

            socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            IPEndPoint remoteEP = new IPEndPoint(Dns.Resolve(ResponseUri.Host).AddressList[0], ResponseUri.Port);
            socket.Connect(remoteEP);
        }