UIpNetDriver::CreateAndBindSocket

Creates, initializes and binds a socket using the given bind address information.

Windows
MacOS
Linux

References

Module

OnlineSubsystemUtils

Header

/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Classes/IpNetDriver.h

Include

#include "IpNetDriver.h"

Source

/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/IpNetDriver.cpp

Syntax

virtual FUniqueSocket CreateAndBindSocket
(
    TSharedRef< FInternetAddr > BindAddr,
    int32 Port,
    bool bReuseAddressAndPort,
    int32 DesiredRecvSize,
    int32 DesiredSendSize,
    FString & Error
)

Remarks

Creates, initializes and binds a socket using the given bind address information.

Returns

if the socket could be created and bound with all the appropriate options, a pointer to the new socket is given, otherwise null

Parameters

Parameter

Description

BindAddr

the address to bind the new socket to, will also create the socket using the address protocol using CreateSocketForProtocol

Port

the port number to use with the given bind address.

bReuseAddressAndPort

if true, will set the socket to be bound even if the address is in use

DesiredRecvSize

the max size of the recv buffer for the socket

DesiredSendSize

the max size of the sending buffer for the socket

Error

a string reference that will be populated with any error messages should an error occur

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