Skip to content

TCPConnection

[Source]

class ref TCPConnection

Constructors

client

[Source]

new ref client(
  auth: TCPConnectAuth val,
  host: String val,
  port: String val,
  from: String val,
  enclosing: TCPConnectionActor ref,
  ler: ClientLifecycleEventReceiver ref)
: TCPConnection ref^

Parameters

Returns


server

[Source]

new ref server(
  auth: TCPServerAuth val,
  fd': U32 val,
  enclosing: TCPConnectionActor ref,
  ler: ServerLifecycleEventReceiver ref)
: TCPConnection ref^

Parameters

Returns


none

[Source]

new ref none()
: TCPConnection ref^

Returns


Public Functions

keepalive

[Source]

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.

fun box keepalive(
  secs: U32 val)
: None val

Parameters

  • secs: U32 val

Returns


local_address

[Source]

Return the local IP address. If this TCPConnection is closed then the address returned is invalid.

fun box local_address()
: NetAddress val

Returns


remote_address

[Source]

Return the remote IP address. If this TCPConnection is closed then the address returned is invalid.

fun box remote_address()
: NetAddress val

Returns


mute

[Source]

Temporarily suspend reading off this TCPConnection until such time as unmute is called.

fun ref mute()
: None val

Returns


unmute

[Source]

Start reading off this TCPConnection again after having been muted.

fun ref unmute()
: None val

Returns


expect

[Source]

fun ref expect(
  qty: USize val)
: None val ?

Parameters

Returns


close

[Source]

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.

fun ref close()
: None val

Returns


hard_close

[Source]

When an error happens, do a non-graceful close.

fun ref hard_close()
: None val

Returns


is_open

[Source]

fun box is_open()
: Bool val

Returns


is_closed

[Source]

fun box is_closed()
: Bool val

Returns


send

[Source]

fun ref send(
  data: (String val | Array[U8 val] val))
: None val

Parameters

Returns