ISocketSubsystem::BindNextPort

Syntax

int32 BindNextPort
(
    class 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

References

Module

Sockets

Header

Runtime/Sockets/Public/SocketSubsystem.h

Source

Runtime/Sockets/Private/SocketSubsystem.cpp