Optional
logger?: LoggerOptional
resolvedefaults to using OS DNS resolver
Readonly
[initProtected
_closedProtected
_closedPProtected
_hostProtected
_portProtected
_typeProtected
loggerProtected
resolveProtected
resolveHostname resolver.
Protected
Optional
serverRegistered server for this socket. If a server is not registered for this socket, all packets for new connections will be dropped.
Protected
socketProtected
socketProtected
socketProtected
socketRest
...params: any[]Gets the type of socket It can be ipv4-only, ipv6-only or dual stack
Protected
handleProtected
handleProtected
handleHandles UDP socket message.
The data
buffer could be multiple coalesced QUIC packets.
It could also be a non-QUIC packet data.
If it is non-QUIC, we can discard the data.
If there are multiple coalesced QUIC packets, it is expected that
all packets are intended for the same connection. This means we only
need to parse the first QUIC packet to determining what connection to route
the data to.
Sends UDP datagram.
Because UDP socket is connectionless, the port and address are required.
This call is used internally by the rest of the library, but it is not
internal because it can be used for hole punching, which is an application
concern. Therefore if this method throws an exception, it does necessarily
mean that this QUICSocket
is an error state. It could be the caller's
fault.
Starts this QUICSocket.
This supports hostnames and IPv4 and IPv6 addresses.
If the host is ::
, this will also bind to 0.0.0.0
.
Optional
host?: stringThe host to bind to. Default is ::
.
Optional
ipv6Whether to only bind to IPv6. Default is false
.
Optional
port?: numberThe port to bind to. Default is 0
.
Optional
reuseWhether to reuse the address. Default is false
.
If bind failed due to
EINVAL or ENOTFOUND. EINVAL is due to using IPv4 host when creating a
udp6
socket. ENOTFOUND is when the hostname does not resolve
or does not resolve to IPv6 when creating a udp6
socket or does not
resolve to IPv4 when creating a udp4
socket.
Generated using TypeDoc
Constructs a QUIC socket.