tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Hamilton <hamil...@grunj.cat.org.au>
Subject RE: Streaming to servlet under Tomcat/IIS
Date Wed, 29 Nov 2000 23:35:21 GMT
>
>
>Anyone have a suggestion how I can stream data from a Socket in
>an Applet to a Servlet running in Tomcat under IIS? The seemingly
>obvious way would be something like:

   what's wrong with java.net.HttpURLConnection for the
   client side??? I guess the Server side is the Servlet
   which already knows how to deal with a HTTP Request....


   Scott, Esq.



>
>
>// Client side:
>Socket s = new Socket(host, port);
>OutputStream os = s.getOutputStream();
>DataOutputStream dos = new DataOutputStream(os);
>dos.writeBytes("GET /proxy HTTP/1.0\r\n\r\n");
>dos.flush();
>...
>
>
>// Server side (inside doGet):
>InputStream is = request.getInputStream();
>byte[] buffer = new byte[8192];
>while(true)
>{
>  int count = is.read(buffer);
>  if(count == -1)
>  {
>      break;
>  }
>  // store buffer...
>}
>...
>
>
>The doGet method in the servlet is in fact called, we know that.
>However, no data is received through the input stream.
>The code simply hangs on the read()-call. Any ideas?
>
>Thanx!
>
>
>
>
>**********************************************************************
>This email and any files transmitted with it are confidential and
>intended solely for the use of the individual or entity to whom they
>are addressed. If you have received this email in error please notify
>the system manager.
>
>This footnote also confirms that this email message has been swept by
>MIMEsweeper for the presence of computer viruses.
>
>www.mimesweeper.com
>**********************************************************************

Mime
View raw message