Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

A design based on Streams? #57

Closed
ClaesNilsson opened this issue Nov 5, 2013 · 11 comments
Closed

A design based on Streams? #57

ClaesNilsson opened this issue Nov 5, 2013 · 11 comments

Comments

@ClaesNilsson
Copy link
Contributor

See https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm and
https://github.com/whatwg/streams

@marcoscaceres
Copy link
Contributor

I would disregard the first link for now. Only look at the WHATWG.

@ClaesNilsson
Copy link
Contributor Author

Conclusions from SysApps meeting at TPAC Nov 12, 2013:

We should work on a Raw Socket API based on Streams. However, the Streams work is complicated and will take time, at least a year, to stabilize. The decisions were:

  • Handle current issues in the current version of the Socket API and publish a new working draft.
  • After this create a new branch for a Socket API based on Streams but keep the current version as a parallell track (as we don't yet know the outcome of the work on Streams)

@marcoscaceres
Copy link
Contributor

The only way to speed up the Stream work is to contribute directly to it and force it to be tested by having something "real" built on top of it. The Socket API should focus itself primarily on connection management, securing the connection, and so on. I would not be in favor of having two versions - twice the work, risk of confusing everyone.

@ytrezq
Copy link

ytrezq commented Nov 12, 2013

Sorry, but I'm not a real expert: What would be the differences with Streams, if I want to create an FTP server with PASSIVE mode (for example)? Would it be harder?

@marcoscaceres
Copy link
Contributor

It certainly would not be harder. You would just wrap a TCP socket and layer the FTP protocol on top. You would, of course, need to implement the protocol yourself - but that's kinda the point of this interface.

Something like:

class FTP{
   var socket; 
   constructor(options){
      var address = URL(option.address).authority; 
      socket = new TCPSocket(address); 
   }

  /*IMPLEMENT FTP COMMANDS* 
 function pwd(){ ... }
 ... and so on... 
}

@ClaesNilsson
Copy link
Contributor Author

Marcos, the idea is to handle most outstanding issues, most of them small, and publish a new public working draft that is a "snapshot" on where we are now. After that my plan is to gradually adapt the editor's draft to Streams.

So having two parallell tracks is maybe not correctly expressed. We have the public draft as "backup".

My focus is Streams and as you see I have an ongoing mail dialogue with Domenic but will start to provide input on their Github page.

@marcoscaceres
Copy link
Contributor

I think republishing sends the wrong message (and has little value, as it doesn't mean we would get any additional contributions). We should only republish with the W3C once we are ready for LC. In the mean time, if we want more reviews and contributions, it would be best to directly seek out domain experts instead of hoping that by republishing they will come to us. For those that do find the version on the /TR/ page, they will be looking at a grossly outdated version, which will either confuse them or put them off.

@ClaesNilsson
Copy link
Contributor Author

The TCPSocket interface has now been rewritten to be based on streams according to the discussion at the WHAT Streams API repo, whatwg/streams#64.

The PR is #63.

I am now continuing with UDP and TCPServer interfaces.

@ClaesNilsson
Copy link
Contributor Author

A short status update of this issue that the UDPSocket and TCPSocket interfaces have been rewritten to be based on Streams. TCPServer still remains.

@ClaesNilsson
Copy link
Contributor Author

Now completely rewritten to be based on the Streams API, https://streams.spec.whatwg.org/

@domenic
Copy link
Contributor

domenic commented Oct 27, 2014

<3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants