ISocketSubsystem::BindNextPort

Bind to next available port.

Windows
MacOS
Linux

References

Module

Sockets

Header

/Engine/Source/Runtime/Sockets/Public/SocketSubsystem.h

Include

#include "SocketSubsystem.h"

Source

/Engine/Source/Runtime/Sockets/Private/SocketSubsystem.cpp

Syntax

int32 BindNextPort
(
    FSocket * Socket,
    FInternetAddr & Addr,
    int32 PortCount,
    int32 PortIncrement
)

Remarks

Bind to next available port.

Returns

The bound port number, or 0 on failure

Parameters

Parameter

Description

Socket

The socket that that will bind to the port

Addr

The local address and port that is being bound to (usually the result of GetLocalBindAddr()). This addresses port number will be modified in place

PortCount

How many ports to try

PortIncrement

The amount to increase the port number by on each attempt

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