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 8279647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:24:02+00:00 2026-06-08T09:24:02+00:00

This week, I messed around with Chromium’s Socket API a bit. But there’s something

  • 0

This week, I messed around with Chromium’s Socket API a bit. But there’s something which isn’t really clear to me about this bad documented experimental interface.

What The docs on Google Code Say:

… about sendTo() at the moment:

Writes data on the given socket.

  1. socketId ( integer ) The socketId.

  2. data ( ArrayBuffer ) The data to
    write.

  3. address ( string )
    The address of the remote machine.

  4. port (
    integer )
    The port of the remote machine.

  5. SendToCallback ( function
    )

But the description of sendTo() is exactly the same as the description of write() (write – Writes data on the given socket.). It’s the same about recvFrom() and read() – both of them have got exactly the same description (read – Reads data from the given socket. / recvFrom – Reads data from the given socket.). But nobody says interesting anything about the differences.

What I Found Out:

It doesn’t matter what I’m doing, sendTo always returns the following object:

  • [-] Object
    • bytesWritten: -2
    • [+] __proto__: Object

If I use write instead of sendTo in all these situations, everything happens as expected.

It’s the same with recvFrom() and read() – read() is working as expected and recvFrom() fails.

My Question(s):

  • What is sendTo() for and what’s the difference between write()
    and sendTo()?
  • What is recvFrom() for and what’s the difference between read() and recvFrom()?
  • Why are there so many akin methods?
  • And: Is there anywhere some more information about the Socket API? The Google Code docs are really lightweight. Aren’t there any articles on chromium.org concerning that?

Thanks.

  • 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-08T09:24:03+00:00Added an answer on June 8, 2026 at 9:24 am

    Apologies for the confusion. We are rolling out an improvement to the documentation based on your question.

    The Chrome socket API is a thin layer over a subset of the POSIX sockets API. It follows the convention that read()/write() are for connected sockets, and sendto()/recvfrom() are for non-connected sockets. At the risk of oversimplifying, you’ll want to use the former for connected-oriented protocols (TCP), and the latter for connectionless protocols (UDP). There’s a good comparison of why one would choose TCP vs. UDP in the Wikipedia article on UDP.

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

Sidebar

Related Questions

Earlier this week, I had to do something which feels like a semantics violation.
This question relates to this question which I asked earlier this week. The answer
I've asked this question already this week but am rephrasing it with the hope
I had a problem this week (which thankfully I've solved in a much better
I was recently reading a question here (some time this week), which I can't
I am trying to get this week's data in sqlite but it seems that
I was bit this week by a bug that occurred when my code was
I've wasted around 30 hours this week writing and re-writing code, believing that I
This week I had to look into a Java WebService project which was using
I worked on this problem for a week, but didn't find any. Please, help

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.