Unreal Engine Plugin
UDP Server
UDP server for Unreal Engine: Blueprint nodes, events and C++ usage with the Internet Protocol plugin.
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>();Datagrams in 4.0
- The receive buffer is 64 KiB by default (16 KiB before). Datagrams that do not fit are dropped and counted instead of closing the socket.
- When the Game Thread falls more than
Max Pending Receive MBbehind, new datagrams are dropped. - Windows ICMP "port unreachable" resets (
WSAECONNRESET) no longer close the socket.
Nodes
Is Open
- Return true if socket is open.
Is Open
Return Value
Local Endpoint
- Get the local endpoint of the socket. Use this function only after open connection.
Local Endpoint
Return Value
Remote Endpoint
- Get the remote endpoint of the socket. Use this function only after open connection.
Remote Endpoint
Return Value
Get Error Code
- Return a struct of the latest error code returned by asio.
Get Error Code
Return Value
Set Recv Buffer Size
- Set receive buffer size in bytes
Set Recv Buffer SizeTarget is UDPServer
Target
Value
Get Max Send Buffer Size
- Get receive buffer size in bytes
Get Recv Buffer SizeTarget is UDPServer
Target
Return Value
Send To
- Broadcasts a string to an specific endpoint.
- It returns false if socket is closed, if buffer is empty or if the send queue limit is exceeded.
Send ToTarget is UDPServer
Target
Message
Callback
Return Value
On Message SentCustom Event
Error Code
Bytes Sent
Send Buffer To
- Broadcasts a buffer to an specific endpoint.
- It returns false if socket is closed, if buffer is empty or if the send queue limit is exceeded.
Send Buffer ToTarget is UDPServer
Target
Buffer
Callback
Return Value
On Message SentCustom Event
Error Code
Bytes Sent
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.
Addressmust be an IP literal,localhostor empty (any address). Host names are not resolved: they, and ports outside 0-65535, fail with anInvalid argumenterror.
BindTarget is UDPServer
Target
Bind Opts
Return Value
Close
- Close the underlying socket and stop listening for data on it. 'on_close' event will be triggered.
CloseTarget is UDPServer
Target
Broadcast and Multicast
New in 4.0. Errors of these nodes are reported through On Error.
Set Broadcast
- Allows sending to broadcast addresses (for example
255.255.255.255or192.168.1.255).
Set BroadcastTarget is UDPServer
Target
Enable
Join Multicast Group
- Joins a multicast group, for example
239.0.0.1orff02::1. Returns false on error.
Join Multicast GroupTarget is UDPServer
Target
Group Address
Return Value
Leave Multicast Group
- Leaves a multicast group joined with
Join Multicast Group.
Leave Multicast GroupTarget is UDPServer
Target
Group Address
Return Value
Set Multicast TTL
- Number of network hops multicast datagrams may cross (
1= local network only).
Set Multicast TTLTarget is UDPServer
Target
Hops
Set Multicast Loopback
- Whether this machine also receives the multicast datagrams it sends.
Set Multicast LoopbackTarget is UDPServer
Target
Enable
Events
On Listening
- This event will be triggered when socket start to listening.
Bind Event to On Listening
Target
Event
On ListeningCustom Event
On Message
- Event triggered when socket send or receive data.
Bind Event to On Message
Target
Event
On MessageCustom Event
Buffer
Bytes Recvd
Endpoint
On Close
- Event triggered when socket is closed.
Bind Event to On Close
Target
Event
On CloseCustom Event
On Error
- Event triggered if any error occur during async process.
Bind Event to On Error
Target
Event
On ErrorCustom Event
Error Code
Options and Structs
Reference of the Internet Protocol Unreal Engine plugin options and structs: client and server bind options, TCP framing, connection stats, error codes and HTTP messages.
TCP Server
TCP server for Unreal Engine: Blueprint nodes, events and C++ usage with the Internet Protocol plugin.