Unreal Engine Plugin
TCP Client
How to use TCP client class
References
#include "TCP/TCPClient.h"
How to use
Blueprint: search by GetInternetProtocolSubsystem
and call CreateTCPClient
function
C++: Use the code bellow
Functions
Set Host
- Set the
adress
andport
of host
Get Socket
- Get socket properties
Set Max Send Buffer Size
- Set max size in bytes of send buffer
Get Max Send Buffer Size
- Get max size in bytes of send buffer
Set Split Package
- If the size of a message exceeds the maximum allowed size for the send buffer, it will be divided into smaller packets before being sent.
Get Split Package
- Get if Split Package is enabled
Send Str
- Send a string message
- Return true if It's able to send
- Warning: If you’re using Windows, ensure that you are sending characters compatible with UTF-8
Send Buffer
- Send a buffer message
- Return true if It's able to send
Connect
- Connect to the host
- Return true if It's able to connect
Close
- Close connection
Get Error Code
- Get latest error code
Events
On Connected
- Event triggered when a connection is estabilished
On Bytes Transferred
- Event triggered when socket send or receive data
On Message Sent
- Event triggered when a message is sent
On Message Received
- Event triggered when a message is received
On Close
- Event triggered when socket is closed
On Error
- Event triggered if any error occur during async process