Node.Net.Socket
- Package
- purescript-node-net
- Repository
- purescript-node/purescript-node-net
#ConnectOptions Source
data ConnectOptionsOptions 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 SocketOptionsOptions 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 IntVersion of IP stack, either 4 or 6.
Defaults to 4.
#connectHints Source
connectHints :: Option ConnectOptions IntDNS lookup hints.
#connectHost Source
connectHost :: Option ConnectOptions StringThe host to configure TCP Sockets.
Determines the host the Socket will attempt to connect to.
Defaults to localhost.
#connectLocalAddress Source
connectLocalAddress :: Option ConnectOptions StringAddress the Socket should connect from.
#connectLocalPort Source
connectLocalPort :: Option ConnectOptions IntPort the Socket should connect from.
#connectPath Source
connectPath :: Option ConnectOptions StringThe path to configure ICP Sockets.
Determines the ICP endpoint the Socket will attempt to connect to.
#connectPort Source
connectPort :: Option ConnectOptions IntThe port to configure TCP Servers.
Determines the TCP endpoint the Server will attempt to listen on.
#connecting Source
connecting :: Socket -> Effect BooleanReturns 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 SocketCreates 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 UnitSets the Encoding for the data read on the Socket.
#setNoDelay Source
setNoDelay :: Socket -> Boolean -> Effect UnitWhen 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 BooleanAllows half open TCP connections.
Defaults to false.
#socketFd Source
socketFd :: Option SocketOptions FileDescriptorCreates a Socket around the given FileDescriptor.
If not specified, creates a new Socket.
#socketHost Source
socketHost :: Option SocketOptions StringThe host to configure TCP Sockets.
Determines the host the Socket will attempt to connect to.
Defaults to localhost.
#socketPath Source
socketPath :: Option SocketOptions StringThe path to configure ICP Sockets.
Determines the ICP endpoint the Socket will attempt to connect to.
#socketPort Source
socketPort :: Option SocketOptions IntThe port to configure TCP Sockets.
Determines the TCP endpoint the Socket will attempt to connect to.
#socketReadable Source
socketReadable :: Option SocketOptions BooleanAllows reads if a FileDescriptor is also set.
Defaults to false.
#socketTimeout Source
socketTimeout :: Option SocketOptions IntPassed to setTimeout when the Socket is created but before it starts
the connection.
#socketWritable Source
socketWritable :: Option SocketOptions BooleanAllows writes if a FileDescriptor is also set.
Defaults to false.
- Modules
- Node.
Net - Node.
Net. Server - Node.
Net. Socket