Navigation
API > API/Runtime > API/Runtime/Sockets
Inheritance Hierarchy
- FSocket
- FSocketEOS
References
| Module | Sockets |
| Header | /Engine/Source/Runtime/Sockets/Public/Sockets.h |
| Include | #include "Sockets.h" |
Syntax
class FSocket
Remarks
This is our abstract base class that hides the platform specific socket implementation
Variables
| Type | Name | Description | |
|---|---|---|---|
| FString | SocketDescription | Debug description of socket usage. | |
| FName | SocketProtocol | Protocol used in creation of a socket | |
| const ESocketType | SocketType | Indicates the type of socket this is |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FSocket () |
Default constructor. | ||
FSocket
(
ESocketType InSocketType, |
Specifies the type of socket being created | ||
FSocket
(
ESocketType InSocketType, |
|||
FSocket
(
ESocketType InSocketType, |
Specifies the type of socket being created |
Destructors
| Type | Name | Description | |
|---|---|---|---|
~FSocket () |
Virtual destructor. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| FSocket * | Accepts a connection that is pending. | ||
| FSocket * | Accept
(
FInternetAddr& OutAddr, |
Accepts a connection that is pending. | |
| bool | Bind
(
const FInternetAddr& Addr |
Binds a socket to a network byte ordered address. | |
| bool | Close () |
Closes the socket | |
| bool | Connect
(
const FInternetAddr& Addr |
Connects a socket to a network byte ordered address. | |
| void | GetAddress
(
FInternetAddr& OutAddr |
Reads the address the socket is bound to and returns it. | |
| ESocketConnectionState | Determines the connection state of the socket. | ||
| FString | Get the debug description of the socket. | ||
| bool | GetPeerAddress
(
FInternetAddr& OutAddr |
Reads the address of the peer the socket is connected to. | |
| int32 | GetPortNo () |
Reads the port this socket is bound to. | |
| FName | GetProtocol () |
Get the type of protocol the socket is bound to | |
| ESocketType | Get the type of protocol the socket is bound to | ||
| bool | HasPendingConnection
(
bool& bHasPendingConnection |
Queries the socket to determine if there is a pending connection. | |
| bool | HasPendingData
(
uint32& PendingDataSize |
Queries the socket to determine if there is pending data on the queue. | |
| bool | JoinMulticastGroup
(
const FInternetAddr& GroupAddress, |
Joins this socket to the specified multicast group on the specified interface. | |
| bool | JoinMulticastGroup
(
const FInternetAddr& GroupAddress |
Joins this socket to the specified multicast group. | |
| bool | LeaveMulticastGroup
(
const FInternetAddr& GroupAddress |
Removes this UDP client from the specified multicast group. | |
| bool | LeaveMulticastGroup
(
const FInternetAddr& GroupAddress, |
Removes this UDP client from the specified multicast group on the specified interface. | |
| bool | Places the socket into a state to listen for incoming connections. | ||
| bool | Recv
(
uint8* Data, |
Reads a chunk of data from a connected socket | |
| bool | RecvFrom
(
uint8* Data, |
Reads a chunk of data from the socket and gathers the source address. | |
| bool | RecvFromWithPktInfo
(
uint8* Data, |
Reads a chunk of data from the socket and gathers the source address and the destination using IP_PKTINFO | |
| bool | RecvMulti
(
FRecvMulti& MultiData, |
Reads multiple packets from the socket at once, gathering the source address and other optional platform specific data. | |
| bool | Sends a buffer on a connected socket. | ||
| bool | SendTo
(
const uint8* Data, |
Sends a buffer to a network byte ordered address. | |
| bool | SetBroadcast
(
bool bAllowBroadcast |
Sets a socket into broadcast mode (UDP only). | |
| bool | SetIpPktInfo
(
bool bEnable |
Sets whether to enable IP_PKTINFO support | |
| bool | Sets whether and how long a socket will linger after closing. | ||
| bool | SetMulticastInterface
(
const FInternetAddr& InterfaceAddress |
Sets the interface used to send outgoing multicast datagrams. | |
| bool | SetMulticastLoopback
(
bool bLoopback |
Enables or disables multicast loopback on the socket (UDP only). | |
| bool | SetMulticastTtl
(
uint8 TimeToLive |
Sets the time to live (TTL) for multicast datagrams. | |
| bool | SetNoDelay
(
bool bIsNoDelay |
Sets this socket into TCP_NODELAY mode (TCP only). | |
| bool | SetNonBlocking
(
bool bIsNonBlocking |
Sets this socket into non-blocking mode. | |
| bool | SetReceiveBufferSize
(
int32 Size, |
Sets the size of the receive buffer to use. | |
| bool | SetRecvErr
(
bool bUseErrorQueue |
Enables error queue support for the socket. | |
| bool | SetRetrieveTimestamp
(
bool bRetrieveTimestamp |
Sets whether to retrieve the system-level receive timestamp, for sockets | |
| bool | SetReuseAddr
(
bool bAllowReuse |
Sets whether a socket can be bound to an address in use. | |
| bool | SetSendBufferSize
(
int32 Size, |
Sets the size of the send buffer to use. | |
| bool | Shutdown
(
ESocketShutdownMode Mode |
Shuts down the socket, making it unusable for reads and/or writes. | |
| bool | Wait
(
ESocketWaitConditions::Type Condition, |
Blocks until the specified condition is met. | |
| bool | WaitForPendingConnection
(
bool& bHasPendingConnection, |
Waits for a pending connection on the socket. |