Example #1
0
 /// <summary>
 /// 停止客户端链接
 /// </summary>
 protected void dispose()
 {
     //if (tcpClient != null) tcpClient.Close();
     tcpClient.shutdown();
     tcpClient = null;
     netSocket = null;
 }
Example #2
0
 /// <summary>
 /// HTTP转发代理
 /// </summary>
 /// <param name="socket">HTTP套接字</param>
 /// <param name="client">HTTP代理服务客户端</param>
 public forwardProxy(socket socket, client client)
 {
     this.socket             = socket;
     this.client             = client;
     requestSocket           = socket.Socket;
     proxySocket             = client.NetSocket;
     requestBuffer           = socket.HeaderReceiver.RequestHeader.Buffer;
     responseBuffer          = socket.Buffer;
     onReceiveRequestHandle  = onReceiveRequest;
     onReceiveResponseHandle = onReceiveResponse;
     onSendResponseHandle    = onSendResponse;
 }
 /// <summary>
 /// HTTP转发代理
 /// </summary>
 /// <param name="socket">HTTP套接字</param>
 /// <param name="client">HTTP代理服务客户端</param>
 public forwardProxy(CommandClientPlus.socket socket, client client)
 {
     this.socket = socket;
     this.client = client;
     requestSocket = socket.Socket;
     proxySocket = client.NetSocket;
     requestBuffer = socket.HeaderReceiver.RequestHeader.Buffer;
     responseBuffer = socket.Buffer;
     onReceiveRequestHandle = onReceiveRequest;
     onReceiveResponseHandle = onReceiveResponse;
     onSendResponseHandle = onSendResponse;
 }
Example #4
0
 /// <summary>
 /// 停止客户端链接
 /// </summary>
 protected void dispose()
 {
     //if (tcpClient != null) tcpClient.Close();
     tcpClient.shutdown();
     tcpClient = null;
     netSocket = null;
 }