Skip to content
This repository was archived by the owner on May 4, 2018. It is now read-only.
This repository was archived by the owner on May 4, 2018. It is now read-only.

rfc: create sockets in uv_*_init() functions #368

@bnoordhuis

Description

@bnoordhuis

Create sockets immediately in uv_tcp_init(), uv_udp_init(), etc. Don't defer until connect() or bind() time.

Benefits:

  1. Less complex, don't have to remember socket options[1].

Drawbacks:

  1. Changes API considerably. Caller now needs to specify the socket type upfront (e.g. IPv4 vs. IPv6). Then again, that means we can remove the uv_tcp_bind() / uv_tcp_bind4() dichotomy.
  2. Pushes burden of async error reporting in case of e.g. EMFILE to user.

I'm tentatively scheduling this for v0.8.

/cc @piscisaureus

[1] Currently broken in various ways. uv_tcp_keepalive() doesn't remember the delay, uv_udp_set_ttl() doesn't work at all, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions