ipsocket package
ipsocket contains no utilities.
License
The ipsocket package is marked as Compatible, which means any game can use it.
Classes
A SocketStream based on TCP/IPv4.
TCPSocket has no methods it didn't inherit.
- socket = SubCritical.Construct("TCPSocket")
socket:SetAddressPart("Host", host)
socket:SetAddressPart("Port", port)
-- normally, you want to handle an error here more gracefully
assert(socket:ApplyAddress())
A ListenSocketStream based on TCP/IPv4.
TCPListenSocket has no methods it didn't inherit.
- listen = SubCritical.Construct("TCPListenSocket")
listen:SetAddressPart("Host", "*") -- * -> INADDR_ANY
listen:SetAddressPart("Port", port)
-- normally, you want to handle an error here more gracefully
assert(listen:ApplyAddress())
A SocketDgram based on UDP/IPv4.
UDPSocket has no methods it didn't inherit.
- socket = SubCritical.Construct("UDPSocket")
socket:SetAddressPart("Host", host)
socket:SetAddressPart("Port", port)
-- normally, you want to handle an error here more gracefully
assert(socket:ApplyAddress())
A ListenSocketDgram based on UDP/IPv4.
UDPListenSocket has no methods it didn't inherit.
- listen = SubCritical.Construct("UDPListenSocket")
listen:SetAddressPart("Host", "*") -- * -> INADDR_ANY
listen:SetAddressPart("Port", port)
-- normally, you want to handle an error here more gracefully
assert(listen:ApplyAddress())
Back to index