Module

Node.Net.Types

Package
purescript-node-net
Repository
purescript-node/purescript-node-net

#IpFamily Source

data IpFamily

Constructors

  • IPv4

    Value-level constructor for the IPv4 ip family

  • IPv6

    Value-level constructor for the IPv6 ip family

Instances

#unsafeFromNodeIpFamily Source

#IPv4 Source

data IPv4 :: IpFamilydata IPv4

Type-level tag for the IPv4 ip family

#IPv6 Source

data IPv6 :: IpFamilydata IPv6

Type-level tag for the IPv6 ip family

#SocketAddress Source

#BlockList Source

#ConnectionType Source

#TCP Source

data TCP :: ConnectionTypedata TCP

#IPC Source

data IPC :: ConnectionTypedata IPC

#Socket Source

data Socket :: ConnectionType -> Typedata Socket t0

Socket extends Duplex and EventEmitter

#Server Source

data Server :: ConnectionType -> Typedata Server t0

Server extends EventEmitter

#NewServerOptions Source

type NewServerOptions :: Row Type -> Row Typetype NewServerOptions r = (allowHalfOpen :: Boolean, keepAlive :: Boolean, keepAliveInitialDelay :: Number, noDelay :: Boolean, pauseOnConnect :: Boolean | r)

allowHalfOpen <boolean> If set to false, then the socket will automatically end the writable side when the readable side ends. Default: false. pauseOnConnect <boolean> Indicates whether the socket should be paused on incoming connections. Default: false. noDelay <boolean> If set to true, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. Default: false. keepAlive <boolean> If set to true, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, similarly on what is done in socket.setKeepAlive([enable][, initialDelay]). Default: false. keepAliveInitialDelay <number> If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.Default: 0.

#NewSocketOptions Source

type NewSocketOptions :: Row Type -> Row Typetype NewSocketOptions r = (allowHalfOpen :: Boolean, fd :: FileDescriptor, readable :: Boolean, writable :: Boolean | r)

fd <number> If specified, wrap around an existing socket with the given file descriptor, otherwise a new socket will be created. allowHalfOpen <boolean> If set to false, then the socket will automatically end the writable side when the readable side ends. See net.createServer() and the 'end' event for details. Default: false. readable <boolean> Allow reads on the socket when an fd is passed, otherwise ignored. Default: false. writable <boolean> Allow writes on the socket when an fd is passed, otherwise ignored. Default: false.

#ConnectTcpOptions Source

type ConnectTcpOptions :: Row Type -> Row Typetype ConnectTcpOptions r = (autoSelectFamily :: Boolean, autoSelectFamilyAttemptTimeout :: Milliseconds, family :: ConnectTcpOptionsFamilyOption, host :: String, keepAlive :: Boolean, keepAliveInitialDelay :: Number, localAddress :: String, localPort :: Int, noDelay :: Boolean, port :: Int | r)

port <number> Required. Port the socket should connect to. host <string> Host the socket should connect to. Default: 'localhost'. localAddress <string> Local address the socket should connect from. localPort <number> Local port the socket should connect from. family <number>: Version of IP stack. Must be 4, 6, or 0. The value 0 indicates that both IPv4 and IPv6 addresses are allowed. Default: 0. noDelay <boolean> If set to true, it disables the use of Nagle's algorithm immediately after the socket is established. Default: false. keepAlive <boolean> If set to true, it enables keep-alive functionality on the socket immediately after the connection is established, similarly on what is done in socket.setKeepAlive([enable][, initialDelay]). Default: false. keepAliveInitialDelay <number> If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.Default: 0. autoSelectFamily <boolean>: If set to true, it enables a family autodetection algorithm that loosely implements section 5 of RFC 8305. The all option passed to lookup is set to true and the sockets attempts to connect to all obtained IPv6 and IPv4 addresses, in sequence, until a connection is established. The first returned AAAA address is tried first, then the first returned A address and so on. Each connection attempt is given the amount of time specified by the autoSelectFamilyAttemptTimeout option before timing out and trying the next address. Ignored if the family option is not 0 or if localAddress is set. Connection errors are not emitted if at least one connection succeeds. Default: false. autoSelectFamilyAttemptTimeout <number>: The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the autoSelectFamily option. If set to a positive integer less than 10, then the value 10 will be used instead. Default: 250.

Note: hints and lookup are not supported for now.

#ConnectTcpOptionsFamilyOption Source

#ConnectIpcOptions Source

type ConnectIpcOptions :: Row Type -> Row Typetype ConnectIpcOptions r = (path :: String | r)

#ListenTcpOptions Source

type ListenTcpOptions :: Row Type -> Row Typetype ListenTcpOptions r = (backlog :: Int, exclusive :: Boolean, host :: String, ipv6Only :: Boolean, port :: Int | r)

port <number> host <string> backlog <number> specifies the maximum length of the queue of pending connections. The actual length will be determined by the OS through sysctl settings such as tcp_max_syn_backlog and somaxconn on Linux. The default value of this parameter is 511 (not 512). exclusive <boolean> Default: false ipv6Only <boolean> For TCP servers, setting ipv6Only to true will disable dual-stack support, i.e., binding to host :: won't make 0.0.0.0 be bound. Default: false.

#ListenIpcOptions Source

type ListenIpcOptions :: Row Type -> Row Typetype ListenIpcOptions r = (backlog :: Int, exclusive :: Boolean, host :: String, path :: String, readableAll :: Boolean, writableAll :: Boolean | r)

host <string> path <string> backlog <number> specifies the maximum length of the queue of pending connections. The actual length will be determined by the OS through sysctl settings such as tcp_max_syn_backlog and somaxconn on Linux. The default value of this parameter is 511 (not 512). exclusive <boolean> Default: false readableAll <boolean> makes the pipe readable for all users. Default: false. writableAll <boolean> makes the pipe writable for all users. Default: false.