-
Notifications
You must be signed in to change notification settings - Fork 0
net.sockets
Peter edited this page Mar 19, 2024
·
5 revisions
v1.8
_G.net.sockets
Signature | Return | Description |
---|---|---|
socketExists(name) |
boolean |
Returns if a socket with name exists |
makeSocket(name, remote, port) |
NetSocket |
Make a new named socket. CLOSES SOCKET IF ONE EXISTS |
getOrMakeSocket(name, remote, port) |
NetSocket |
Gets named socket, or creates one if not present, returning the socket |
getSocket(name) |
NetSocket? |
Gets named socket |
closeSocket(name) |
nil |
Closes the named socket and removes it |
listSockets() |
string[] |
Get a list of the names of all tracked sockets |
NetSocket(remote, port) |
NetSocket |
Variable | Description |
---|---|
[NetSocketType: string ] |
Message type for net sockets: socket
|
net.sockets.socketExists(name: string): boolean
Returns if a socket with name exists
-
name: string
- Socket name
exists: boolean
net.sockets.makeSocket(name: string, remote: string|NetAddress, port: number): NetSocket
Make a new named socket. CLOSES SOCKET IF ONE EXISTS
-
name: string
- Socket name -
remote: string|NetAddress
- Socket remote address (hostname, IP or HW) -
port: number
- Socket port
socket: NetSocket
net.sockets.getOrMakeSocket(name: string, remote: string|NetAddress, port: number): NetSocket
Gets named socket, or creates one if not present, returning the socket
-
name: string
- Socket name -
remote: string|NetAddress
- Socket remote address (hostname, IP or HW) -
port: number
- Socket port
socket: NetSocket
net.sockets.getSocket(name: string): NetSocket?
Gets named socket
-
name: string
- Socket name
socket: NetSocket?
net.sockets.closeSocket(name: string): nil
Closes the named socket and removes it
-
name: string
- Socket name
net.sockets.listSockets(): string[]
Get a list of the names of all tracked sockets
socketNames: string[]