Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Added support for binding the socket to address and port #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

somec
Copy link

@somec somec commented Mar 3, 2018

The default behavior is to bind the socket to all interfaces on a
random port. On a multi-homed node it sometimes is preferred if
the socket was only bound to a specific address.

The underlying dgram socket from node has the necessary support for
binding to an address, if that address is specified while binding.

Added options to new Session(options)

  • sourceAddress: The IP address to bind the socket to, and where
    requests are coming from. Must be an IP address on the node, if
    specified. Default is to bind to all interfaces.

  • sourcePort: The UDP port number to bind the socket to, and where
    requests are coming from. Default: 0 (random).

The default behavior is to bind the socket to all interfaces on a
random port. On a multi-homed node it sometimes is preferred if
the socket was only bound to a specific address.

The underlying dgram socket from node has the necessary support for
binding to an address, if that address is specified while binding.

Added options to new Session(options)

* sourceAddress: The IP address to bind the socket to, and where
  requests are coming from. Must be an IP address on the node, if
  specified. Default is to bind to all interfaces.

* sourcePort: The UDP port number to bind the socket to, and where
  requests are coming from. Default: 0 (random).
@bangert
Copy link
Collaborator

bangert commented Mar 6, 2018

This looks good. Thank you!

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

Successfully merging this pull request may close these issues.

2 participants