sysapps / tcp-udp-sockets

Raw sockets API
86 stars 25 forks source link

Open event needed for TCPServerSocket and UDPSocket? #44

Open ClaesNilsson opened 11 years ago

ClaesNilsson commented 11 years ago

[Patrick]

  • the server socket API doesn't need an onOpen event.. there is nothing that happens in between the constructor and onOpen that could block

[Ke-Fong]: socket() + bind() + listen() have "immediate" non blocking effect indeed.

[Claes] [Claes] The reason for the open event for TCPServerSocket and UDPSocket was the concern that Jonas expressed in https://github.com/sysapps/raw-sockets/issues/24 but if there is no time consuming actions, e.g. allocating a local interface, we should remove the open event.

ClaesNilsson commented 10 years ago

Could one argument for keeping the 'open' event be that it might take some time to check if the selected local address/port pair is already in use by another application?

marcoscaceres commented 10 years ago

I would kill it for now and add it back in later if the issue you mentioned occurs in practice.

ClaesNilsson commented 9 years ago

The open event has been replaced by the opened attribute which is of type Promise. We could consider if this attribute could be removed for UDP and TCPServer sockets and consider the closed attribute to cover error handling.