471,071 Members | 1,177 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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 1914

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

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.