Skip to content

PonyTCP

[Source]

primitive val PonyTCP

Constructors

create

[Source]

new val create()
: PonyTCP val^

Returns


Public Functions

listen

[Source]

fun box listen(
  the_actor: AsioEventNotify tag,
  host: String val,
  port: String val,
  ip_version: IPVersion = reference)
: AsioEventID

Parameters

Returns


accept

[Source]

fun box accept(
  event: AsioEventID)
: I32 val

Parameters

Returns


close

[Source]

fun box close(
  fd: U32 val)
: None val

Parameters

Returns


connect

[Source]

fun box connect(
  the_actor: AsioEventNotify tag,
  host: String val,
  port: String val,
  from: String val,
  asio_flags: U32 val,
  ip_version: IPVersion = reference)
: U32 val

Parameters

Returns


keepalive

[Source]

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

Parameters

Returns


peername

[Source]

fun box peername(
  fd: U32 val,
  ip: NetAddress ref)
: Bool val

Parameters

Returns


receive

[Source]

Receive up to size bytes into buffer. Returns the tri-state socket result plus the number of bytes received on SocketResultOk. The call is synchronous and non-blocking on every platform: SocketResultRetry means no data was available (EWOULDBLOCK/WSAEWOULDBLOCK), SocketResultError means an unrecoverable error or peer close.

fun box receive(
  event: AsioEventID,
  buffer: Pointer[U8 val] tag,
  size: USize val)
: (SocketResult , USize val)

Parameters

Returns


shutdown

[Source]

fun box shutdown(
  fd: U32 val)
: None val

Parameters

Returns


sockname

[Source]

fun box sockname(
  fd: U32 val,
  ip: NetAddress ref)
: Bool val

Parameters

Returns


writev

[Source]

Send count buffers from data starting at index from via writev. Builds the IOV array of (pointer, size) entries internally; the runtime turns it into iovec (POSIX) or WSABUF (Windows) as needed.

first_buffer_byte_offset skips bytes in data(from) for partial write resume.

Returns the tri-state socket result plus the number of bytes sent on SocketResultOk. The call is synchronous and non-blocking on every platform.

fun box writev(
  event: AsioEventID,
  data: Array[ByteSeq] box,
  from: USize val,
  count: USize val,
  first_buffer_byte_offset: USize val = 0)
: (SocketResult , USize val) ?

Parameters

Returns


writev_max

[Source]

Maximum number of (pointer, size) entries a single writev call may carry. IOV_MAX on POSIX, 1 on Windows.

fun box writev_max()
: I32 val

Returns


eq

[Source]

fun box eq(
  that: PonyTCP val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: PonyTCP val)
: Bool val

Parameters

Returns