x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Problem while connecting PS4 game client to a windows dedicated server. Error: binding to port 0 failed

Hello, I'm trying to connect a PS4 game client to a windows dedicated server but I'm getting the following error:

 LogNet:Warning: Failed to init net driver ConnectURL: [dedicated ip]//Game/Maps/StartupMap: BSD: binding to port 0 failed (5)
 LogNet:Warning: error initializing the network stack
 LogNet: DestroyNamedNetDriver PS4NetDriver_0 [PendingNetDriver]
 LogExit: PendingNetDriver PS4NetDriver_0 shut down
 LogNet:Warning: Travel Failure: [PendingNetGameCreateFailure]: BSD: binding to port 0 failed (5)
 LogNet: TravelFailure: PendingNetGameCreateFailure, Reason for Failure: 'BSD: binding to port 0 failed (5)'
 LogNet:Warning: Travel Failure: [ClientTravelFailure]:
 LogNet: TravelFailure: ClientTravelFailure, Reason for Failure: ''


I have made the following change on PS4SocketSubsystem.cpp to set bInIsP2P to false:

 //return ( Socket != INVALID_SOCKET ) ? new FPS4Socket( Socket, SOCKTYPE_Datagram, SocketDescription, true, this ) : nullptr;
 return (Socket != INVALID_SOCKET) ? new FPS4Socket(Socket, SOCKTYPE_Datagram, SocketDescription, false, this) : nullptr;


And I have a custom PS4Engine.ini file with this content:

 [/Script/Engine.Engine]
 +NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemPS4.PS4NetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
 
 [OnlineSubsystem]
 DefaultPlatformService=PS4
 PollingIntervalInMs=20
 
 [OnlineSubsystemPS4]
 bEnabled=true

And also tried with this:

 [/Script/Engine.Engine]
 !NetDriverDefinitions=ClearArray
 +NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemPS4.PS4NetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
 
 [OnlineSubsystem]
 DefaultPlatformService=PS4
 PollingIntervalInMs=20
 
 [OnlineSubsystemPS4]
 bEnabled=true

But both of them finally gives me the same error when trying to connect to the server.

I have no problems with a windows game client so I think is a PS4 related problem. Does anyone know how to make it run?

Thanks.

Product Version: UE 4.8
Tags:
more ▼

asked Nov 27 '15 at 01:15 PM in C++ Programming

avatar image

jmairena
6 1 3 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

And a better solution, in which you haven't to change any code on the engine: just tell the game to use the default IpNetDriver instead the PS4 one. You can do that because the only method that PS4NetDriver implements is the one that use CreateSocket.

So just set the Game\Config\PS4\PS4Engine.ini file like this:

 [/Script/Engine.Engine]
 !NetDriverDefinitions=ClearArray
 +NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
 
 [OnlineSubsystem]
 DefaultPlatformService=PS4
 PollingIntervalInMs=20
 
 [OnlineSubsystemPS4]
 bEnabled=true
more ▼

answered Dec 02 '15 at 10:45 AM

avatar image

jmairena
6 1 3 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Ok, I solved it.

I leave my Game\Config\PS4\PS4Engine.ini file like this:

 Game\Config\PS4\PS4Engine.ini
 [/Script/Engine.Engine]
 !NetDriverDefinitions=ClearArray
 +NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemPS4.PS4NetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
 
 [OnlineSubsystem]
 DefaultPlatformService=PS4
 PollingIntervalInMs=20
 
 [OnlineSubsystemPS4]
 bEnabled=true

And leave PS4SocketSubsystem.cpp without changes. But I have changed a code line on PS4NetDriver.cpp:

 //return SocketSubsystem->CreateSocket( FName( "UDPP2P" ), TEXT( "Unreal" ) );
 return SocketSubsystem->CreateSocket( NAME_DGram, TEXT("Unreal"));

This way I force PS4 to don't use P2P in order to connect to a Windows dedicated server normally.

more ▼

answered Dec 02 '15 at 09:04 AM

avatar image

jmairena
6 1 3 3

avatar image virtual_nomak Nov 01 '17 at 11:48 AM

Oh thanks for this! I had the same issue but I was trying to connect to a PS4 as a listen server, I don't know much about networking and I still need to understand what an UDPP2P socket does, but this solved my issue! thanks a ton.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question