471,354 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Non blocking socket send

Hi all,

under heavy load i get a SocketException when calling socket.Send method on
non blocking socket with error code 10035 WSAEWOULDBLOCK.

my question is , how do i know the number of bytes that was successfully
send (though there was an exception) so i will not have to send the whole
buffer again ?

Thanks.

Feb 8 '06 #1
1 2861
Thanks Vadym.
"Vadym Stetsyak" wrote:
Hello, yaron!

y> under heavy load i get a SocketException when calling socket.Send method
y> on non blocking socket with error code 10035 WSAEWOULDBLOCK.

y> my question is , how do i know the number of bytes that was successfully
y> send (though there was an exception) so i will not have to send the
y> whole buffer again ?

There were no bytes sent as this error indicates that whole operation cannot be completed.

From docs on WSAWOULDBLOCK
"
This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.
"

So, all you have to do is to retry the send operation.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot

Feb 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Christopher H. Laco | last post: by
3 posts views Thread by Robert A. van Ginkel | last post: by
reply views Thread by Blog the Haggis | last post: by
3 posts views Thread by mp | last post: by
1 post views Thread by AlannY | last post: by
reply views Thread by XIAOLAOHU | 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.