Node.Net.Socket
- Package
- purescript-node-net
- Repository
- purescript-node/purescript-node-net
#ConnectOptions Source
data ConnectOptions
Options to configure the connecting side of a Socket
.
These options decide whether the Socket
is ICP or TCP.
One of path
or port
must be set.
Setting path
will make the Socket
ICP.
Setting port
will make the Socket
TCP.
#SocketOptions Source
data SocketOptions
Options to configure the basics of a Socket
.
#bufferSize Source
bufferSize :: Socket -> Effect (Maybe Int)
The number of characters buffered to be written on a Socket
.
N.B. The number of characters is not equal to the number of bytes.
#connectFamily Source
connectFamily :: Option ConnectOptions Int
Version of IP stack, either 4
or 6
.
Defaults to 4
.
#connectHints Source
connectHints :: Option ConnectOptions Int
DNS lookup hints.
#connectHost Source
connectHost :: Option ConnectOptions String
The host to configure TCP Socket
s.
Determines the host the Socket
will attempt to connect to.
Defaults to localhost
.
#connectLocalAddress Source
connectLocalAddress :: Option ConnectOptions String
Address the Socket
should connect from.
#connectLocalPort Source
connectLocalPort :: Option ConnectOptions Int
Port the Socket
should connect from.
#connectPath Source
connectPath :: Option ConnectOptions String
The path to configure ICP Socket
s.
Determines the ICP endpoint the Socket
will attempt to connect to.
#connectPort Source
connectPort :: Option ConnectOptions Int
The port to configure TCP Server
s.
Determines the TCP endpoint the Server
will attempt to listen on.
#connecting Source
connecting :: Socket -> Effect Boolean
Returns true
if connect
was called, but the 'connect'
event hasn't
been emitted yet.
Returns false
any other time.
#createConnection Source
createConnection :: Options SocketOptions -> Effect Unit -> Effect Socket
Creates an ICP or TCP Socket
, initiates a connection,
returns the Socket
, adds the callback as a one-time listener for the
'connect'
event, and emits the 'connect'
event.
#localAddress Source
localAddress :: Socket -> Effect (Maybe String)
Attempts to return the address a client is connecting on.
E.g. if a client connects from 192.168.1.1
,
the result would be Just "192.168.1.1"
.
#remoteAddress Source
remoteAddress :: Socket -> Effect (Maybe String)
Attempts to return the address a Socket
is connected to.
#remoteFamily Source
remoteFamily :: Socket -> Effect (Maybe String)
Attempts to return the IP family a Socket
is connected to,
either "IPv4"
or "IPv6"
.
#remotePort Source
remotePort :: Socket -> Effect (Maybe Int)
Attempts to return the port a Socket
is connected to.
#setEncoding Source
setEncoding :: Socket -> Encoding -> Effect Unit
Sets the Encoding
for the data read on the Socket
.
#setNoDelay Source
setNoDelay :: Socket -> Boolean -> Effect Unit
When true
, disables the Nagle algorithm and sends data immedately.
When false
, enables the Nagle algorithm and buffers data before sending.
#socketAllowHalfOpen Source
socketAllowHalfOpen :: Option SocketOptions Boolean
Allows half open TCP connections.
Defaults to false
.
#socketFd Source
socketFd :: Option SocketOptions FileDescriptor
Creates a Socket
around the given FileDescriptor
.
If not specified, creates a new Socket
.
#socketHost Source
socketHost :: Option SocketOptions String
The host to configure TCP Socket
s.
Determines the host the Socket
will attempt to connect to.
Defaults to localhost
.
#socketPath Source
socketPath :: Option SocketOptions String
The path to configure ICP Socket
s.
Determines the ICP endpoint the Socket
will attempt to connect to.
#socketPort Source
socketPort :: Option SocketOptions Int
The port to configure TCP Socket
s.
Determines the TCP endpoint the Socket
will attempt to connect to.
#socketReadable Source
socketReadable :: Option SocketOptions Boolean
Allows reads if a FileDescriptor
is also set.
Defaults to false
.
#socketTimeout Source
socketTimeout :: Option SocketOptions Int
Passed to setTimeout
when the Socket
is created but before it starts
the connection.
#socketWritable Source
socketWritable :: Option SocketOptions Boolean
Allows writes if a FileDescriptor
is also set.
Defaults to false
.
- Modules
- Node.
Net - Node.
Net. Server - Node.
Net. Socket