Internet Protocol
Unreal Engine Plugin

UDP Server

How to use UDP server class

References

#include "udp/udpserver.h"

How to use

Blueprint: search by GetInternetProtocolSubsystem and call CreateUDPServer function

C++: Use the code bellow

#include "udp/udpserver.h"

UUDPServer* net = NewObject<UUDPServer>();

Nodes

Is Open

  • Return true if socket is open.
𝑓
Is Open
Return Value
Output pin

Local Endpoint

  • Get the local endpoint of the socket. Use this function only after open connection.
𝑓
Local Endpoint
Return Value
Output pin

Remote Endpoint

  • Get the remote endpoint of the socket. Use this function only after open connection.
𝑓
Remote Endpoint
Return Value
Output pin

Get Error Code

  • Return a struct of the latest error code returned by asio.
𝑓
Get Error Code
Return Value
Output pin

Set Recv Buffer Size

  • Set receive buffer size in bytes
𝑓
Set Recv Buffer Size
Target is UDPServer
Input pin
Input pin
Target
Input pin
Value
Output pin

Get Max Send Buffer Size

  • Get receive buffer size in bytes
𝑓
Get Recv Buffer Size
Target is UDPServer
Input pin
Target
Return Value
Output pin

Send To

  • Broadcasts a string to an specific endpoint.
  • It returns false if socket is closed or if buffer is empty.
𝑓
Send To
Target is UDPServer
Input pin
Input pin
Target
Input pin
Message
Input pin
Callback
Output pin
Return Value
Output pin
On Message Sent
Custom Event
Output pin
Error Code
Output pin
Bytes Sent
Output pin

Send Buffer To

  • Broadcasts a buffer to an specific endpoint.
  • It returns false if socket is closed or if buffer is empty.
𝑓
Send Buffer To
Target is UDPServer
Input pin
Input pin
Target
Input pin
Buffer
Input pin
Callback
Output pin
Return Value
Output pin
On Message Sent
Custom Event
Output pin
Error Code
Output pin
Bytes Sent
Output pin

Bind

  • Listen for datagram messages on a named port and optional address.
  • It returns false if socket is already open or if asio return any error code during the bind.
𝑓
Bind
Target is UDPServer
Input pin
Input pin
Target
Input pin
Bind Opts
Output pin
Return Value
Output pin

Close

  • Close the underlying socket and stop listening for data on it. 'on_close' event will be triggered.
𝑓
Close
Target is UDPServer
Input pin
Input pin
Target
Output pin

Events

On Listening

  • This event will be triggered when socket start to listening.
Bind Event to On Connected
Input pin
Input pin
Target
Input pin
Event
Output pin
On Connected
Custom Event
Output pin

On Message

  • Event triggered when socket send or receive data.
Bind Event to On Message
Input pin
Input pin
Target
Input pin
Event
Output pin
On Message
Custom Event
Output pin
Buffer
Output pin
Bytes Recvd
Output pin
Endpoint
Output pin

On Close

  • Event triggered when socket is closed.
Bind Event to On Close
Input pin
Input pin
Target
Input pin
Event
Output pin
On Close
Custom Event
Output pin

On Error

  • Event triggered if any error occur during async process.
Bind Event to On Error
Input pin
Input pin
Target
Input pin
Event
Output pin
On Error
Custom Event
Output pin
Error Code
Output pin