type
constructors
make |
Make a new unbound, unconnected TCP socket. |
---|
methods
bind |
Bind this socket to the specified local address. |
---|---|
close |
Close this socket and its associated IO streams. |
config |
Get the |
connect |
Connect this socket to the specified address and port. |
in |
Get the input stream used to read data from the socket. |
isBound |
Is this socket bound to a local address and port. |
isClosed |
Is this socket closed. |
isConnected |
Is this socket connected to the remote host. |
localAddr |
Get the bound local address or null if unbound. |
localPort |
Get the bound local port or null if unbound. |
options |
Access the SocketOptions used to tune this socket. |
out |
Get the output stream used to write data to the socket. |
remoteAddr |
Get the remote address or null if not connected. |
remotePort |
Get the remote port or null if not connected. |
shutdownIn |
Place input stream for socket at "end of stream". |
shutdownOut |
Disables the output stream for this socket. |
upgradeTls |
Get a new TCP socket that is upgraded to use TLS. |
Slot Details
bind
close
config
src
SocketConfig config()
Get the socket configuration
for this socket.
connect
src
This connect(IpAddr addr, Int port, Duration? timeout := this.config().connectTimeout)
Connect this socket to the specified address and port. This method will block until the connection is made. Throw IOErr if there is a connection error. If a non-null timeout is specified, then block no longer then the specified timeout before raising an IOErr. If timeout is null, then a system default is used. The default timeout is configured via SocketConfig.connectTimeout
.
in
isBound
isClosed
isConnected
localAddr
localPort
make
src
new make(SocketConfig config := SocketConfig.cur())
Make a new unbound, unconnected TCP socket. The socket will be configured using the given socket configuration
. The following configuration applies to a TCP socket:
options
src
@Deprecated { msg="Use SocketConfig" }
SocketOptions options()
Access the SocketOptions used to tune this socket. The following options apply to TcpSockets:
- inBufferSize
- outBufferSize
- keepAlive
- receiveBufferSize
- sendBufferSize
- reuseAddr
- linger
- receiveTimeout
- noDelay
- trafficClass Accessing other option fields will throw UnsupportedErr.