none
buffer space or because a queue was full

    Question

  •  

    Hello

               I am working on network project .......

     

    I am getting an error "An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full"

     

    Please see the code below

     

     

     

    _Objsock = new Socket(AddressFamily.InterNetwork,

    SocketType.Dgram, ProtocolType.Udp);

     

    //Assign the any IP of the machine and listen on port number 1000

    IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Any, 5000);

    EndPoint Rep = (EndPoint)ipEndPoint;

     

    //Bind this address to the server

    _Objsock.Bind(Rep);

     

    IPEndPoint ipeSender = new IPEndPoint(IPAddress.Any, 0);

    //The epSender identifies the incoming clients

    EndPoint epSender = (EndPoint)ipeSender;

     

    while (true)

    {

    //Start receiving data

    _Objsock.BeginReceiveFrom(data, 0, data.Length,

    SocketFlags.None, ref epSender,

    new AsyncCallback(ReceiveCallback), epSender);

    }

    Wednesday, April 23, 2008 6:58 AM

Answers

  • That generally means that the sender or receiver is sending too much data across the network.  Networks can only handle so much data at a time.  If you send too much data then the sender/receiver will overflow its buffer and reject the call.  Generally to send large packets of data you have to implement a handshaking algorithm where you send a block of data and wait for the response.  In my network app we send blocks of about 65K at max.  You then have to wait for the receiver to respond back otherwise you don't know when it is safe to send more data.

     

    Michael Taylor - 4/23/08

    http://p3net.mvps.org

     

    Wednesday, April 23, 2008 2:33 PM
    Moderator

All replies

  • That generally means that the sender or receiver is sending too much data across the network.  Networks can only handle so much data at a time.  If you send too much data then the sender/receiver will overflow its buffer and reject the call.  Generally to send large packets of data you have to implement a handshaking algorithm where you send a block of data and wait for the response.  In my network app we send blocks of about 65K at max.  You then have to wait for the receiver to respond back otherwise you don't know when it is safe to send more data.

     

    Michael Taylor - 4/23/08

    http://p3net.mvps.org

     

    Wednesday, April 23, 2008 2:33 PM
    Moderator
  • Hi there Michael:

    I've been getting this exception (10055 socketException) when uploading big files (>100MB) to a web service, do you know how to slow down my transmission rate? I mean, when calling a web service, since the socket is wrapped into a proxy class...

    Thanks for any help.


    I need to do, I need to know.
    Wednesday, December 22, 2010 10:24 PM