468,785 Members | 1,672 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,785 developers. It's quick & easy.

Socket.Available != 0 but Socket.Read throws an exception

Hello Everybody,

I have the following problem with Socket:
Socket.Available reports data in the buffer (e.g. 1849 bytes) but I can't
read it because Socket.Read throws an exception
The exception ist being thrown because the connection is already closed. How
could I read the data from the buffer?

background information:
I open multiple connections to my Windows 2003 Web Server (simple HTTP GET).

pseudocode:
while (true) {
foreach open socket {
if should read
read
if should write
write
}

if new connection needed
create new connection
}

The IIS sends the data and closes the connection imediatelly. Sometimes my
application is not ready to "read" because it's doing something else at the
moment.
Shouldn't I be able to access the buffer even if the connection is closed by
the server?

Thanks!
tomek


Nov 16 '05 #1
0 1845

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Robert A. van Ginkel | last post: by
5 posts views Thread by Terry | last post: by
reply views Thread by Tomasz Naumowicz | last post: by
2 posts views Thread by Droopy | last post: by
2 posts views Thread by Nuno Magalhaes | last post: by
1 post views Thread by CARIGAR | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.