Module jls.net.Tcp
TCP socket base class.
Class Tcp
tcp:getLocalName () | Returns the local name of this TCP socket. |
tcp:getRemoteName () | Returns the remote name of this TCP socket. |
tcp:isClosed () | Tells whether or not this TCP socket is closed. |
tcp:close (callback) | Closes this TCP socket. |
Class Tcp
The Tcp base class.
- tcp:getLocalName ()
-
Returns the local name of this TCP socket.
Returns:
-
string
the local name of this TCP socket.
- tcp:getRemoteName ()
-
Returns the remote name of this TCP socket.
Returns:
-
string
the remote name of this TCP socket.
- tcp:isClosed ()
-
Tells whether or not this TCP socket is closed.
Returns:
-
boolean
true if the TCP socket is closed.
- tcp:close (callback)
-
Closes this TCP socket.
Parameters:
- callback function an optional callback function to use in place of promise.
Returns:
-
jls.lang.Promise
a promise that resolves once the socket is closed.