Non blocking socket send

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yaron

    #1

    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.

  • yaron

    #2
    Re: Non blocking socket send

    Thanks Vadym.


    "Vadym Stetsyak" wrote:
    [color=blue]
    > 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[/color]

    Comment

    Working...