tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John.Nordga...@vesta.no
Subject Streaming to servlet under Tomcat/IIS
Date Wed, 29 Nov 2000 08:55:36 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:


// 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