Navigation
API > API/Runtime > API/Runtime/Networking
Implements a fluent builder for UDP sockets.
| Name | FUdpSocketBuilder |
| Type | class |
| Header File | /Engine/Source/Runtime/Networking/Public/Common/UdpSocketBuilder.h |
| Include Path | #include "Common/UdpSocketBuilder.h" |
Syntax
class FUdpSocketBuilder
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FUdpSocketBuilder
(
const FString& InDescription |
Creates and initializes a new instance. | Common/UdpSocketBuilder.h |
Structs
| Name | Remarks |
|---|---|
| FMulticastGroup | Holds the list of joined multicast groups. |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AllowBroadcast | bool | Holds a flag indicating whether broadcasts will be enabled. | Common/UdpSocketBuilder.h | |
| Blocking | bool | Holds a flag indicating whether socket operations are blocking. | Common/UdpSocketBuilder.h | |
| Bound | bool | Holds a flag indicating whether the socket should be bound. | Common/UdpSocketBuilder.h | |
| BoundEndpoint | FIPv4Endpoint | Holds the IP address (and port) that the socket will be bound to. | Common/UdpSocketBuilder.h | |
| Description | FString | Holds the socket's debug description text. | Common/UdpSocketBuilder.h | |
| JoinedGroups | TArray< FMulticastGroup > | Common/UdpSocketBuilder.h | ||
| MulticastInterface | FIPv4Address | Holds the IP address of the interface to use for outgoing multicast datagrams. | Common/UdpSocketBuilder.h | |
| MulticastLoopback | bool | Holds a flag indicating whether multicast loopback will be enabled. | Common/UdpSocketBuilder.h | |
| MulticastTtl | uint8 | Holds the multicast time to live. | Common/UdpSocketBuilder.h | |
| ReceiveBufferSize | int32 | The desired size of the receive buffer in bytes (0 = default). | Common/UdpSocketBuilder.h | |
| Reusable | bool | Holds a flag indicating whether the bound address can be reused by other sockets. | Common/UdpSocketBuilder.h | |
| SendBufferSize | int32 | The desired size of the send buffer in bytes (0 = default). | Common/UdpSocketBuilder.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Sets socket operations to be blocking. | Common/UdpSocketBuilder.h | ||
| Sets socket operations to be non-blocking. | Common/UdpSocketBuilder.h | ||
| Makes the bound address reusable by other sockets. | Common/UdpSocketBuilder.h | ||
FUdpSocketBuilder & BoundToAddress
(
const FIPv4Address& Address |
Sets the local address to bind the socket to. | Common/UdpSocketBuilder.h | |
FUdpSocketBuilder & BoundToEndpoint
(
const FIPv4Endpoint& Endpoint |
Sets the local endpoint to bind the socket to. | Common/UdpSocketBuilder.h | |
FUdpSocketBuilder & BoundToPort
(
uint16 Port |
Sets the local port to bind the socket to. | Common/UdpSocketBuilder.h | |
FSocket * Build() |
Builds the socket as configured. | Common/UdpSocketBuilder.h | |
FUdpSocketBuilder & JoinedToGroup
(
const FIPv4Address& GroupAddress, |
Joins the socket to the specified multicast group. | Common/UdpSocketBuilder.h | |
FUdpSocketBuilder & JoinedToGroup
(
const FIPv4Address& GroupAddress |
Joins the socket to the specified multicast group. | Common/UdpSocketBuilder.h | |
FUdpSocketBuilder & WithBroadcast() |
Enables broadcasting. | Common/UdpSocketBuilder.h | |
FUdpSocketBuilder & WithMulticastInterface
(
const FIPv4Address& InterfaceAddress |
Sets the multicast outgoing interface. | Common/UdpSocketBuilder.h | |
| Enables multicast loopback. | Common/UdpSocketBuilder.h | ||
FUdpSocketBuilder & WithMulticastTtl
(
uint8 TimeToLive |
Sets the multicast time-to-live. | Common/UdpSocketBuilder.h | |
FUdpSocketBuilder & WithReceiveBufferSize
(
int32 SizeInBytes |
Specifies the desired size of the receive buffer in bytes (0 = default). | Common/UdpSocketBuilder.h | |
FUdpSocketBuilder & WithSendBufferSize
(
int32 SizeInBytes |
Specifies the desired size of the send buffer in bytes (0 = default). | Common/UdpSocketBuilder.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
operator FSocket *() |
Implicit conversion operator that builds the socket as configured. | Common/UdpSocketBuilder.h |