question

sergey avatar image
sergey asked

Is it possible to connect two PlayFab servers?

Hi there!

Our game uses client-lobby-server architechture. Lobby is a playfab server to which users connect and gather in rooms. When a room is ready to play, lobby creates a new game server on playfab and needs to send it the details about the game. But for some reason I always get connection timeout after not more then one second when trying to establish a TCP connection between lobby and the newly spawned server.

I tried two scenarios:

1) Connect to the server from lobby. Get the server's TCP port from RequestMultiplayerServer method and establish a connection right after the server is started.

2) Connect to the lobby from the server. Send the lobby address and port via SessionCookie and establish a connection on the server. In this case the lobby always listens for connections from servers.

But in either of those scenarios I get instant connection timeout.

Is there any limitation/firewall inside playfab ecosystem which doesn't allow to connect between two servers? Or my problem is in the different realm?

Looking forward to your help. Thanks!

Custom Game Servers
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sergey avatar image sergey commented ·

UPD: the timeout is not actually instant, it happens after ~25 seconds

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ sergey commented ·

May I ask does the TCP connection is established successfully? Do you use different server builds for lobby and server? How is the Port set for your server build?

0 Likes 0 ·
sergey avatar image sergey Seth Du ♦ commented ·

Lobby and Server are different builds. Lobby has a TCP port and Server tries to connect to it. Lobby address and port are sent to the Server via SessionCookie and they do match, as in it's not the error in port number or smth like that. The connection doesn't get established on either side.

0 Likes 0 ·
Seth Du avatar image
Seth Du answered

I am not very sure, but do you keep the TCP listener active all the time? It is because in the normal scenario, after the game starts, the server may close the listener to avoid additional connections. Will defining additional ports solve this issue?

Moreover, since the MPS of PlayFab is hosted on Azure and using Docker to manage server instances. Meanwhile the IP and port returned by PlayFab APIs are all public external address, even though they may be in the same private internal network. Few times of NAT translation may be an issue, but I am not an expert on it. We suggest you contact Azure networking expert on their community to have dedicated support.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sergey avatar image sergey commented ·

@SethDu, yeah, I also though about NAT issues there... I'll try to find somebody from Azure to ask this question. Thanks for your support!

0 Likes 0 ·
sergey avatar image
sergey answered

After some research I learned that Azure applies security measures to restrict network traffic between VMs. Is there any documentation or config options for this on PlayFab?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

Unfortunately, in most subscription plans, users cannot access Azure backend configuration portal. If you want to optimize your current requirement (Lobby-server system), please feel free to create a new thread so that we can track and provide suggestions.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.