internal static void CreateTunnel(Session oSession, bool bStreamResponse) { if (oSession == null || oSession.oRequest == null || oSession.oRequest.headers == null || oSession.oRequest.pipeClient == null || oSession.oResponse == null) { return; } ClientPipe pipeClient = oSession.oRequest.pipeClient; if (pipeClient == null) { return; } if (bStreamResponse) { oSession.oRequest.pipeClient = null; } ServerPipe pipeServer = oSession.oResponse.pipeServer; if (pipeServer == null) { return; } if (bStreamResponse) { oSession.oResponse.pipeServer = null; } GenericTunnel genericTunnel = new GenericTunnel(oSession, pipeClient, pipeServer, bStreamResponse); oSession.__oTunnel = genericTunnel; new Thread(new ThreadStart(genericTunnel.RunTunnel)) { IsBackground = true }.Start(); }
internal static void CreateTunnel(Session oSession, bool bStreamResponse) { if (((oSession != null) && (oSession.oRequest != null)) && (((oSession.oRequest.headers != null) && (oSession.oRequest.pipeClient != null)) && (oSession.oResponse != null))) { ClientPipe pipeClient = oSession.oRequest.pipeClient; if (pipeClient != null) { if (bStreamResponse) { oSession.oRequest.pipeClient = null; } ServerPipe pipeServer = oSession.oResponse.pipeServer; if (pipeServer != null) { if (bStreamResponse) { oSession.oResponse.pipeServer = null; } GenericTunnel tunnel = new GenericTunnel(oSession, pipeClient, pipeServer, bStreamResponse); oSession.__oTunnel = tunnel; new Thread(new ThreadStart(tunnel.RunTunnel)) { IsBackground = true }.Start(); } } } }