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

  • Home
  • SEARCH
  • 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 8521473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:50:10+00:00 2026-06-11T06:50:10+00:00

I am using ssize_t send(int sockfd, const void *buf, size_t len, int flags); from

  • 0

I am using ssize_t send(int sockfd, const void *buf, size_t len, int flags); from socket.h file. I have some doubts about it.

Doubt 1:If suppose the string I am passing to send is of length 10 and the length i specified in the third parameter is 15. Then what will send only send 10 chars or it will send 15 chars (which it gets by reading unallocated memory for last 5 chars).
What will happen in the reverse case means if length of second parameter is more than third parameter.

Doubt 2:I am assuming the length of second parameter is equal to third parameter. Now if the second parameter is say – "abc\0def\0qw". Its length is 11. Will send send the whole string or \0 have any of its effect. I think it will send the whole string. How really send works.

If someone know any good source about send, recv which discuss these function in depth pls share.

  • 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-06-11T06:50:12+00:00Added an answer on June 11, 2026 at 6:50 am

    The send function knows nothing about “strings”. If you give it a pointer, and tell it to send the next 15 bytes after that pointer, then that is EXACTLY what it will try to do. (You may well encounter a Seg-Fault or similar if you give it an inappropriate len value).

    There is no justification for believing that it would stop just because it finds a byte with value 0x00. After all, many network protocols are FILLED with 0x00 all over the place. You can’t have send stopping every time it happens to find that value.

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

Sidebar

Related Questions

I am trying to send audio file from one computer to other using socket
I have a client that sends me data using this function: void CServerRetrieve::Send(char *buf,
I have this piece of code using standard sockets: void set_fds(int sock1, int sock2,
I have a question about the send method of C. int send (int socket,
Like : using ::size_t; using ::fpos_t; using ::FILE; In fact it's a question inspired
my application sends file to server using (socket tcp c#) the file transfer works
I have to send and receive dynamic data using a SysV message queue for
I have a simple file transfer application, which transfers 4096 bytes per write from
I am using following code: Note that i HAVE TO SEND SQL Query so
I am trying to send a SOAP request from a xml file and send

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.