TCPConnection¶
Constructors¶
client¶
new ref client(
auth: TCPConnectAuth val,
host: String val,
port: String val,
from: String val,
enclosing: TCPConnectionActor ref,
ler: ClientLifecycleEventReceiver ref)
: TCPConnection ref^
Parameters¶
- auth: TCPConnectAuth val
- host: String val
- port: String val
- from: String val
- enclosing: TCPConnectionActor ref
- ler: ClientLifecycleEventReceiver ref
Returns¶
- TCPConnection ref^
server¶
new ref server(
auth: TCPServerAuth val,
fd': U32 val,
enclosing: TCPConnectionActor ref,
ler: ServerLifecycleEventReceiver ref)
: TCPConnection ref^
Parameters¶
- auth: TCPServerAuth val
- fd': U32 val
- enclosing: TCPConnectionActor ref
- ler: ServerLifecycleEventReceiver ref
Returns¶
- TCPConnection ref^
none¶
Returns¶
- TCPConnection ref^
Public Functions¶
keepalive¶
Sets the TCP keepalive timeout to approximately secs
seconds. Exact
timing is OS dependent. If secs
is zero, TCP keepalive is disabled. TCP
keepalive is disabled by default. This can only be set on a connected
socket.
Parameters¶
- secs: U32 val
Returns¶
- None val
local_address¶
Return the local IP address. If this TCPConnection is closed then the address returned is invalid.
Returns¶
- NetAddress val
remote_address¶
Return the remote IP address. If this TCPConnection is closed then the address returned is invalid.
Returns¶
- NetAddress val
mute¶
Temporarily suspend reading off this TCPConnection until such time as
unmute
is called.
Returns¶
- None val
unmute¶
Start reading off this TCPConnection again after having been muted.
Returns¶
- None val
expect¶
Parameters¶
- qty: USize val
Returns¶
- None val ?
close¶
Attempt to perform a graceful shutdown. Don't accept new writes. If the connection isn't muted then we won't finish closing until we get a zero length read. If the connection is muted, perform a hard close and shut down immediately.
Returns¶
- None val
hard_close¶
When an error happens, do a non-graceful close.
Returns¶
- None val
is_open¶
Returns¶
- Bool val
is_closed¶
Returns¶
- Bool val
send¶
Parameters¶
Returns¶
- None val