जवाब man 2 send
के दूसरे खंड में है:
When the message does not fit into the send buffer of the socket,
send() normally blocks, unless the socket has been placed in nonblock‐
ing I/O mode. In nonblocking mode it would fail with the error EAGAIN
or EWOULDBLOCK in this case. The select(2) call may be used to deter‐
mine when it is possible to send more data.
या, वैकल्पिक रूप से, POSIX संस्करण (man 3p send
):
If space is not available at the sending socket to hold the message to
be transmitted, and the socket file descriptor does not have O_NONBLOCK
set, send() shall block until space is available. If space is not
available at the sending socket to hold the message to be transmitted,
and the socket file descriptor does have O_NONBLOCK set, send() shall
fail. The select() and poll() functions can be used to determine when
it is possible to send more data.
तो, जबकि आंशिक डेटा की एक read
आम है , ब्लॉकिंग मोड में आंशिक send
नहीं होना चाहिए (कार्यान्वयन विवरण को छोड़कर)।
स्रोत
2012-09-29 22:32:22
-1: बिल्कुल पीछे की ओर - किसी भी स्ट्रीम आधारित प्रोटोकॉल (जैसे कि टीसीपी) के लिए, प्रेषण अनुरोध की गई राशि से कम वापस आ सकता है, यदि स्थानीय बफर पहले से ही पहले से ही भरा हुआ है। डेटाग्राम प्रोटोकॉल (जैसे यूडीपी) के लिए, प्रेषण या तो असफल हो जाएगा या पूरे बफर को एक पैकेट के रूप में भेज देगा - कोई आंशिक भेजना संभव नहीं है। –
मैंने नीचे मतदान नहीं किया, लेकिन मेरा जवाब देखें, आप गलत हैं। –
@ किरील किरोव - आप और क्रिस डोड बिल्कुल सही के रूप में। माफी माफ करना - माफ करना। मैंने अपना जवाब सही कर दिया है। धन्यवाद! – paulsm4