473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Java socket read - why doesn't IIS close the socket?

Hi everybody,

I'm having problems with the following code:

InputStream hostIn = hostSock.getInputStream();

while (true) {
try {
iRead = hostIn.read(m_Buf);
}
catch (IOException ex1) {
System.out.println("Error on receive.");
}
if (iRead == -1) {
break;
}
m_HostRcv.add(new ByteArr( (byte[]) m_Buf.clone(), iRead) );
rcvSum += iRead;
}

This code works fine with Apache webservers. hostIn.read returns -1 if
there is nothing left to read. On IIS webservers the read method
simply blocks if there is nothing left to receive. IIS doesn't seem to
close the socket. What can I do to avoid this? How do other people
handle this?

Thanks in advance for your postings.

Jonny
Jul 17 '05 #1
0 1729

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JatP | last post by:
hi Everyone I am trying to create a server and client to send files from one side to the other. I can send files from one side to the other using bufferedinput/output streams but when trying to...
0
by: Dominique | last post by:
I am trying to communicate to a prolog server from a java client, however even though the connection is successfully made every time I try to perform QueryExecute I get an error, either Socket...
4
by: google | last post by:
Dear newsgroup, I give up, I must be overseeing something terribly trivial, but I can't get a simple (Java) applet to react to incoming (python) SocketServer messages. Without boring you with...
4
by: yaron | last post by:
Hi, I have a problem when sending data over TCP socket from c# client to java server. the connection established ok, but i can't send data from c# client to java server. it's work ok with...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
3
by: akmkat | last post by:
Hi all, I am in a great problem. I am trying to implement a multithreaded server using java, first look at the code... /*------- Main Server (server.java)--------------*/ import java.io.* ;...
11
by: atlaste | last post by:
Hi, In an attempt to create a full-blown webcrawler I've found myself writing a wrapper around the Socket class in an attempt to make it completely async, supporting timeouts and some scheduling...
3
by: madsornomads | last post by:
Hi all, I have a problem with reading from a Java server after I have written to it - it just hangs. It works fine if I just write to the server and not try to write. I have read the HOWTO on...
3
by: TsanChung | last post by:
I want to make a java TCP socket client to communicate with a TCP server socket on linux. Are there some sample C unix server and java client socket programs available? The Richard Stevens'...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.