Internet Protocol
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

#include "TCP/TCPClient.h"
 
UTCPClient* TcpClient = NewObject<UTCPClient>();

Functions

Set Host

  • Set the adress and port of host TCP client

Get Socket

  • Get socket properties TCP client

Set Max Send Buffer Size

  • Set max size in bytes of send buffer TCP client

Get Max Send Buffer Size

  • Get max size in bytes of send buffer TCP client

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. TCP client

Get Split Package

  • Get if Split Package is enabled TCP client

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 TCP client

Send Buffer

  • Send a buffer message
  • Return true if It's able to send TCP client

Connect

  • Connect to the host
  • Return true if It's able to connect TCP client

Close

  • Close connection TCP client

Get Error Code

  • Get latest error code TCP client

Events

On Connected

  • Event triggered when a connection is estabilished TCP client

On Bytes Transferred

  • Event triggered when socket send or receive data TCP client

On Message Sent

  • Event triggered when a message is sent TCP client

On Message Received

  • Event triggered when a message is received TCP client

On Close

  • Event triggered when socket is closed TCP client

On Error

  • Event triggered if any error occur during async process TCP client

On this page