Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home for chromium.org
« Groups Home
Supporting TCP listening/server socket in chrome.experimental.socket API
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ningxin hu  
View profile  
 More options May 29 2012, 9:08 pm
From: ningxin hu <ningxin...@intel.com>
Date: Tue, 29 May 2012 18:08:19 -0700 (PDT)
Local: Tues, May 29 2012 9:08 pm
Subject: Supporting TCP listening/server socket in chrome.experimental.socket API
Currently chrome.experimental.socket API doesn't support TCP
listening/
server socket. With TCP listening/server socket, extensions could
expose services such as for remote control, system integration etc.,

So I propose to add TCP listening/server socket support with some new
APIs:
[nodoc] namespace experimental.socket {
  ...
  dictionary AcceptInfo {
    // The id of the newly connected socket.
    long socketId;

    // Peer address of the connection.
    DOMString address;
    long port;
  };

  callback AcceptCallback = void (AcceptInfo acceptInfo);
  ...
  interface Functions {
    ...
    // Listens for connections on a TCP socket. The socket should be
    // bound to a local endpoint before listening.
    // |socketId| : The socketId.
    // |backlog| : The maximum length of the queue of the pending
    // connections. The default value is 5.
    static void listen(long socketId,
                       optional long backlog);

    // Accepts a connection on a listening socket.
    // |socketId| : The socketId of the listening socket.
    // |callback| : called when accept attempt is completed.
    static void accept(long socketId,
                       AcceptCallback callback);
  };

};

An example of APIs usage is:
//------------------------------------------------------------------------- ----------------------------------------
var listening_socket_id = -1;
var server_socket_id = -1;

function dataReceived(info) {
  if (info.resultCode > 0) {
    chrome.experimental.socket.write(server_socket_id,
                                                      info.data,
                                                      function (info)
{ });
  }

};

function connectionAccepted(info) {
  if (info.socketId > 0) {
    server_socket_id = info.socketId;
    chrome.experimental.socket.read(server_socket_id, dataReceived);
  }

};

function socketBound(result) {
  if (result == 0) {
    chrome.experimental.socket.listen(listening_socket_id);
    chrome.experimental.socket.accept(listening_socket_id,

connectionAccepted);
  }

};

function socketCreated(info) {
  listening_socket_id = info.socketId;
  chrome.experimental.socket.bind(listening_socket_id, "127.0.0.1",
                                                   8800, socketBound);

};

chrome.experimental.socket.create("tcp", socketCreated);
//------------------------------------------------------------------------- ---------------------------------------------

Thoughts? Concerns? If folks like this proposal, I will upload a CL
for review.

BTW, I cannot find the existing socket proposal
page under http://dev.chromium.org/developers/design-documents/extensions/.
Is it hosted in another place?

Thanks,
-ningxin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ryan  
View profile  
 More options Jun 4 2012, 6:32 pm
From: ryan <ryanack...@gmail.com>
Date: Mon, 4 Jun 2012 15:32:26 -0700 (PDT)
Local: Mon, Jun 4 2012 6:32 pm
Subject: Re: Supporting TCP listening/server socket in chrome.experimental.socket API
Yeah, someone at Google forgot to do a few things. This API isn't
listed under http://code.google.com/chrome/extensions/experimental.html#overview
but googling for it shows this page:

http://code.google.com/chrome/extensions/experimental.socket.html

I would have never known about it unless I accidentally saw this
post.

On May 30, 11:08 am, ningxin hu <ningxin...@intel.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Tsao  
View profile  
 More options Jun 5 2012, 12:18 pm
From: Mike Tsao <mi...@chromium.org>
Date: Tue, 5 Jun 2012 09:18:04 -0700
Local: Tues, Jun 5 2012 12:18 pm
Subject: Re: [crx] Re: Supporting TCP listening/server socket in chrome.experimental.socket API
See http://code.google.com/searchframe#OAMlx_jo-ck/src/chrome/common/exte....
The IDL marks these APIs with the "nodoc" attribute because they're
very early in the experimental development process, and it would be
misleading to potential developers to begin documenting them on the
website.

Ryan, you are correct that "someone [on the Chromium team] forgot to
do a few things." Specifically, the document generator was briefly
failing to completely respect the nodoc attribute, causing a very
outdated version of the page you've cited to be rolled out to the
website as an orphan. That page should not exist. The IDL, however,
will remain authoritative.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
PhistucK  
View profile  
 More options Jun 5 2012, 1:10 pm
From: PhistucK <phist...@gmail.com>
Date: Tue, 5 Jun 2012 20:10:18 +0300
Local: Tues, Jun 5 2012 1:10 pm
Subject: Re: [crx] Re: Supporting TCP listening/server socket in chrome.experimental.socket API

Note that I saw a change list
<http://codereview.chromium.org/10440097/>that is going to take it out
of experimental.

☆*PhistucK*


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »