FTcpSocketBuilder

Implements a fluent builder for TCP sockets.

Windows
MacOS
Linux

References

Module

Networking

Header

/Engine/Source/Runtime/Networking/Public/Common/TcpSocketBuilder.h

Include

#include "Common/TcpSocketBuilder.h"

Syntax

class FTcpSocketBuilder

Remarks

Implements a fluent builder for TCP sockets.

Constructors

Name Description

Public function

FTcpSocketBuilder

(
    const FString& InDescription
)

Creates and initializes a new instance.

Functions

Name Description

Public function

FTcpSocketBu...

 

AsBlocking()

Sets socket operations to be blocking.

Public function

FTcpSocketBu...

 

AsNonBlocking()

Sets socket operations to be non-blocking.

Public function

FTcpSocketBu...

 

AsReusable()

Makes the bound address reusable by other sockets.

Public function

FTcpSocketBu...

 

AsReusable

(
    bool bInReusable
)

Sets re-usability of the bound address by other sockets.

Public function

FTcpSocketBu...

 

BoundToAddress

(
    const FIPv4Address& Address
)

Sets the local address to bind the socket to.

Public function

FTcpSocketBu...

 

BoundToEndpoint

(
    const FIPv4Endpoint& Endpoint
)

Sets the local endpoint to bind the socket to.

Public function

FTcpSocketBu...

 

BoundToPort

(
    int32 Port
)

Sets the local port to bind the socket to.

Public function Const

FSocket *...

 

Build()

Builds the socket as configured.

Public function

FTcpSocketBu...

 

Lingering

(
    int32 Timeout
)

Sets how long the socket will linger after closing.

Public function

FTcpSocketBu...

 

Listening

(
    int32 MaxBacklog
)

Sets the socket into a listening state for incoming connections.

Public function

FTcpSocketBu...

 

WithReceiveBufferSize

(
    int32 SizeInBytes
)

Specifies the desired size of the receive buffer in bytes (0 = default).

Public function

FTcpSocketBu...

 

WithSendBufferSize

(
    int32 SizeInBytes
)

Specifies the desired size of the send buffer in bytes (0 = default).

Operators

Name Description

Public function Const

 

operator FSocket *()

Implicit conversion operator that builds the socket as configured.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss