CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    May 2009
    Posts
    12

    send() return value

    Hello, i got a question, and would be nice if someone can help me.

    1) Is it safe to closesocket() right after send() in case send returns the correct ammount of bytes sent?

    I thought it was, but now im thinking maybe im wrong.
    After having problems with a program im writing, i did some research and it seems that the return value of send (bytes sent if no error) is the ammount of bytes "sent" to some TCP buffer, wich will later send the bytes to the peer.

    2) So, closing the socket right after send() can make it impossible to the peer to recv if the socket has been closed before the bytes were actually sent through the network?

    Thanks in advance.

    ****************************
    Solved

    The answer is (in case someone is interested)
    Yes, that can happen.
    Last edited by stratoforce; June 22nd, 2009 at 05:15 PM. Reason: Solved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured