ReCT Documentation

v2.1

TCP datatypes


ReCTs TCP Networking has 3 Datatypes.

They are all in one Article because they are more or less connected.


TCP Client

The TCP Client Datatype holds a Networking Client.

To create one, you will need to open a connection:

var someClient <- ConnectTCPClient("IP", 1234);

Functions

The TCP Client Datatype has 6 built in Functions:


Write(<text-> string>)

Writes the given text to the SendBuffer and flushes it.



WriteLine(<text-> string>)

Writes the given line to the SendBuffer and flushes it.



Read()

Reads whatever is inside the ReceiveBuffer.



ReadLine()

Reads one line of the ReceiveBuffer, if there is none then wait.



Close()

Will Close the connection.



IsConnected()

Will check if the Client is connected and returns the result as a bool.



TCP Listener

The TCP Listener Datatype holds a Networking Server-Side Listener.

To create one, you will need to start listening on a Port:

var someListener <- ListenOnTCPPort(1234);

Functions

The TCP Listener Datatype has only 1 built in Function:


OpenSocket()

Will wait for a Client to Connect and then return a Socket.




TCP Socket

The TCP Socket Datatype holds a Networking Server-Side Socket.

To create one, you will need to accept a Client connection:

var someSocket <- someListener >> OpenSocket();

Functions

The TCP Socket has the same functions as the TCP Client.