Functions for working with network sockets.
net | Functions for working with network sockets. |
Exceptions | |
SocketException | Indicates some kind of socket error. |
Types | |
Socket | Opaque type representing a network socket. |
Functions | |
tcpSocket | Create a new TCP/IP (stream) socket. |
select | Select sockets with pending activity subject to an optional timeout. |
Socket. | Accept an incoming connection request on a socket and returns a new socket. |
Socket.bind | Bind a socket to an address and port number. |
Socket. | Close a socket. |
Socket. | Connect a socket to a given host and port. |
Socket. | Listen for incoming connections on a specific port. |
Socket.recv | Receive (read) bytes from a socket. |
Socket. | Receive (read) bytes from a socket, also returning the remote address where they came from. |
Socket.send | Send (write) bytes to a socket. |
Create a new TCP/IP (stream) socket.
DECLARE NATIVE FUNCTION tcpSocket(): Socket
Select sockets with pending activity subject to an optional timeout.
FUNCTION select( INOUT read, write, error: Array<Socket>, timeout_seconds: Number ): Boolean
Accept an incoming connection request on a socket and returns a new socket.
FUNCTION Socket.accept( self: Socket ): Socket
Bind a socket to an address and port number.
FUNCTION Socket.bind( self: Socket, address: String, port: Number )
Close a socket.
FUNCTION Socket.close( self: Socket )
Connect a socket to a given host and port.
FUNCTION Socket.connect( self: Socket, host: String, port: Number )
Listen for incoming connections on a specific port.
FUNCTION Socket.listen( self: Socket, port: Number )
Receive (read) bytes from a socket.
FUNCTION Socket.recv( self: Socket, count: Number ): Bytes
Receive (read) bytes from a socket, also returning the remote address where they came from.
FUNCTION Socket.recvfrom( self: Socket, count: Number, OUT remote_address: String, OUT remote_port: Number ): Bytes
Send (write) bytes to a socket.
FUNCTION Socket.send( self: Socket, data: Bytes )