Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6787337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:21:15+00:00 2026-05-26T17:21:15+00:00

When I create a TCP socket in blocking mode and use the send (or

  • 0

When I create a TCP socket in blocking mode and use the send (or sendto) functions, when the will the function call return?

Will it have to wait till the other side of the socket has received the data? In that case, if there is traffic jam on the internet, could it block for a long time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:21:15+00:00Added an answer on May 26, 2026 at 5:21 pm

    Both the sender and the receiver (and possibly intermediaries) will buffer the data.

    Sending data successfully is no guarantee that the receiving end has received it.

    Normally writes to a blocking socket, won’t block as long as there is space in the sending-side buffer.

    Once the sender’s buffer is full, then the write WILL block, until there is space for the entire write in it.

    If the write is partially successful (the receiver closed the socket, shut it down or an error occurred), then the write might return fewer bytes than you had intended. A subsequent write should give an error or return 0 – such conditions are irreversible on TCP sockets.

    Note that if a subsequent send() or write() gives an error, then some previously written data could be lost forever. I don’t think there is a real way of knowing how much data actually arrived (or was acknowledged, anyway).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a Python TCP/IP server for internal use, using win32serviceutil/py2exe to create
When using a blocking TCP socket, I don't have to specify a buffer size.
I have a TCP server that creates a (blocking) socket, waits until it is
If you create a TCP client socket with port 0 instead of a non-zero
I'm trying to create a TCP connection and send/read data that uses SSL, but
I want to create a new net.tcp://localhost:x/Service endpoint for a WCF service call, with
i am using pcap to create a packet sniffer. i have this tcp structure:
I want to create a TCP socket that listens only on a specific interface
I have a worker thread that is listening to a TCP socket for incoming
I want to open a TCP client socket in Python. Do I have to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.