Effect Tcppub

Source
:effect(pub) Tcp
  .tcp-connect ( Str AnyInt  (Result AnyInt Str) )
  .tcp-send ( AnyInt Str  (Result AnyInt Str) )
  .tcp-recv ( AnyInt AnyInt  (Result Str Str) )
  .tcp-close ( AnyInt  (Result Unit Str) )
Description

TCP socket effect. Operations manipulate connection handles represented as integer identifiers.

Parent chain:IONetTcp

Operations

.tcp-connect ( Str AnyInt (Result AnyInt Str) )

Connects to a host:port pair and returns a connection handle.

.tcp-send ( AnyInt Str (Result AnyInt Str) )

Sends data on an existing TCP connection and returns bytes written.

.tcp-recv ( AnyInt AnyInt (Result Str Str) )

Reads up to the given number of bytes from a TCP connection.

.tcp-close ( AnyInt (Result Unit Str) )

Closes a TCP connection handle.