question

Samson avatar image
Samson asked

Port not established when debugging locally?

When I was debugging my server locally in a container, I provided 2 port mappings. However, after the server entered the Active state, I didn't see the port being established.

Did I understand anything wrong?

port-mapping.png (48.9 KiB)
6 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.

Samson avatar image Samson commented ·

Another question is, if 2 port mappings are provided, which one is binded to the port returned by the GetMatch API?

0 Likes 0 ·
Samson avatar image Samson Samson commented ·

Ignore this comment. The API returns the ports with their names, so we know which is which.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Samson commented ·

Could you please tell us do you use the Photon bolt official PlayFab sample -- Bolt-Sample/PlayFab at master BoltEngine/Bolt-Sample (github.com)? And could you provide the MultiplayerSettings?

0 Likes 0 ·
Samson avatar image Samson Sarah Zhang commented ·

No. The port that cannot be established was monitored by an old version of bolt. Let me check the offical sample you give and see if I can find anything.

0 Likes 0 ·
Show more comments
Sarah Zhang avatar image Sarah Zhang commented ·

We can reproduce it in the local debugging of our default Unity Mirror Sample. We will dig into it.

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

We researched it in the Unity Mirror Sample, and we found that if you want to display the listened ports in netstat, there are some conditions need to be meet.

  1. Listen the ports that will be forwarded, for your case, it is 9080.
  2. Establish the connection for the port. For example, you can use the client to connect the port once at least.

Have you listened the port 9080 in your server code, and have you tried to connect to it? If you have met the conditions, and the ports still can’t display in the netstat, could you please provide the main code snippet?

About the question of can’t locally debug the Bolt official sample, you may need to follow the Bolt document -- 3 - Photon Bolt PlayFab Server Integration | Photon Engine to set up the project. If you can’t enter the server(PlayFabGame) scene but always enter the client(PlayFabClient) scene, you can try to change the default scene navigation to load the PlayFabGame scene directly.

10 |1200

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

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.