The code below is taken from 
ingoingFilter
 in 
HTTPQoS
Line 1 detects if the request has in input stream to measure. Line 3 creates an instance of 
PipedOutputStream named 
pout
. Line 4 creates an instance of 
PipedInputStream
, 
pin
 to 
which 
pout
 is passed as a parameter. This effectively means that whatever is fed to 
pout
 will 
automatically be passed to 
pin
.  
HTTPQoS.java 
1. if(request.hasOutputStream()){ 
2.    try { 
3.       PipedOutputStream pout = new PipedOutputStream(); 
4.       PipedInputStream  pin  = new PipedInputStream(pout); 
5.       new RequestDataMover(request.getOutputStream(),pout,myQOSParameters); 
6.       request.setOutputStream(pin); 
7.    } 
8.    catch (Exception ex) {} 
9.    } 
10. 
}
In line 5 a new instance of 
RequestDataMover 
in instantiated, the constructor of which is 
passed the current requests input stream, the instance of PipedOutputStream 
pout
 and an 
instance of 
QoSParameters
. Finally in line 6, the requests output stream is passed 
pin
. What 
this effectively allows is to monitor the request's output stream without interrupting it as it is 
passed to the target server. The implication of this are that the time data flows can be 
measured as can the amount of data transferred to the server. Additionally since the 
RequestDataMover
 is threaded it does not cause the filter to block. 
a
a
c




  

Home

About Services Network Support FAQ Order Contact
 

Quality Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting 

Lunarwebhost.net  Business web hosting division of Vision Web Hosting Inc. All rights reserved