Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by itsjustnils · May 19 at 03:25 PM ·

LocalMultiplayerAgent Docker unable to connect (even with all firewalls and virusscanners disabled)

Hi all!

While following this guide: How to run a game server using LocalMultiplayerAgent in Container mode, I seem to run in to the issue where I can't connect to my dockerized game server.

When running the server in docker via the LocalMultiplayerAgent.exe all seems to work just fine. I'm getting heartbeats and the game server becomes "Active".

Now I'm supposed to test the connection to the game server by parsing "http://127.0.0.1:56100/Hello" in my browser. But I'm running into a "ERR_CONNECTION_TIMED_OUT" when trying to do so.

Also when disabling all my security measures, like firewalls and virusscanners, I can't connect to the container.

I'm saying I can't connect to the container because even when pressing the "Open in Browser" button in docker itself will give me a "ERR_CONNECTION_TIMED_OUT" response.

Can anyone tell me if they ran into a similar issue? Or pointers as to how this might be fixed?

This is the port config of the container:


Cheers!

Comment

People who like this

0 Show 1
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image itsjustnils · May 19 at 03:27 PM 0
Share

Apparently copy-pasting images will show them while drafting, but will get lost once posting XD.

This is the port config image:

1.jpg (4.8 kB)

4 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Dimitris Gkanatsios · May 27 at 05:40 PM

@itsjustnils in which port are you initializing your server? When using process mode, you need to grab the port using the GSDK -> MpsSamples/AgentListener.cs at main PlayFab/MpsSamples (github.com)

(that's a best practice for using containers as well)

Comment

People who like this

0 Show 5 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image itsjustnils · May 27 at 10:11 PM 0
Share

Hi Dimitri,

That's exactly what I've been doing. I'm getting back the "game_port". I'm letting my server listen to the "game_port" - "ServerListeningPort".

What I noticed is that both the "ClientConnection" as well as the "ServerListening" ports are mapped to the same port (30000). But I guess this is expected when working with a process-based build?

Then on client side I request a game server and get the "game_port" there as well.



playfab-session-info.jpg (52.4 kB)
client-connection-failed.jpg (122.2 kB)
avatar image itsjustnils · May 27 at 10:13 PM 0
Share

Here's two more screenshots from some logs of my server (as I'm allowed to only upload 2 per comment).

Both "ClientConnection" and "ServerListening" ports are mapped at 30000:

Server is listening on port 30000:

server-listening.jpg (10.8 kB)
serverports.jpg (44.5 kB)
avatar image itsjustnils · May 27 at 11:36 PM 0
Share

I've also tried to set up a container build again, these are the ports:

Server is listening to the "ServerListeningPort"

Connecting to the server should then be done via port 30000, but still no such luck (also tried connecting via port 7777 to be sure).

I'm starting to feel at a loss here.

Had no problems getting a server up and running with GameLift. I'm still considering PlayFab because of it's (supposed) ease of use compared to Amazon.

And I'm still not able to connect to my server locally if it's run as a container, getting the error "An existing connection was forcibly closed by the remote host" if I try.

ports.jpg (56.3 kB)
server.jpg (13.1 kB)
avatar image itsjustnils · May 27 at 11:59 PM 0
Share

Apologies for spam, but I'm using this to share as much findings as possible. Seems I'm getting a

SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

error now

I'm guessing this means the server is unable to respond? Firewall maybe?

avatar image itsjustnils · May 28 at 02:45 PM 0
Share

Today I've ripped out DarkRift2 and replaced it with Mirror for Unity. I'm getting the exact same results. I can't find what I'm doing wrong and this is what ends my efforts in terms of trying to use PlayFab for our product. Cheers.

avatar image

Answer by Gosen Gao · May 20 at 08:57 AM

Have you tested your server directly without the LocalMultiplayerAgent, and what is the excepted result for the HTTP request “http://127.0.0.1:56100/Hello”? According to the image you post, container port 30000 is mapped to local 56100. Please make sure your server is listening to port 30000/tcp, you can check the port states by entering into this docker container.

Comment

People who like this

0 Show 4 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image itsjustnils · May 20 at 01:40 PM 0
Share

The expected result for "http://127.0.0.1:56100/Hello" would be something more than a timeout. I'm not sure what to expect other than the tutorial telling me I should use it to test if everything is set up correctly.

My server is indeed listening to port 30000. When trying to connect locally without any PlayFab "interference" (running both server and client in unity editor, no playfab tools used) on 127.0.0.1:30000 everything is working as expected.

avatar image Dimitris Gkanatsios itsjustnils · May 23 at 05:04 AM 0
Share

The /Hello endpoint is specific for the wrapper game sample we have posted on GitHub. What is the Unity project you are using? If this doesn't expose a web server, it makes sense that you are not seeing results from querying the /Hello endpoint.

avatar image Dimitris Gkanatsios Dimitris Gkanatsios · May 23 at 05:06 AM 0
Share

This is the wrapper sample that should be used with the tutorial MpsSamples/wrappingGsdk at main PlayFab/MpsSamples (github.com)

Show more comments
avatar image

Answer by itsjustnils · May 21 at 01:23 PM

I've tried everything withing my knowledge and a lot of things I found on the internet what might solve my problem. Please be aware that this isn't my first ever mutliplayer project I'm working on, but it is my first ever PlayFab integration I've been looking in to for over a week now.

Ended up using GameLift's integration instead, I had no problem getting my own custom server migrated to it's requirements and managed to get everything up and running (both connecting locally as connecting to my deployed gameplay server) within a day.

I think you should look at what GameLift is doing well and try to learn from it, both on documentation- as well as tech workflow level.

Thanks for your support tho.

Cheers!

Comment

People who like this

0 Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image itsjustnils · May 21 at 01:24 PM 0
Share

So many typos and I can't seem to find the "edit" button XD

avatar image

Answer by Dimitris Gkanatsios · May 30 at 07:26 PM

I'm sorry you're having issues. On process mode, the ServerListeningPort should be the same as the ClientConnectionPort.

It might be a firewall issue, not sure. Have you checked the Mirror sample here? MpsSamples/UnityMirror at main PlayFab/MpsSamples (github.com)

Is the server process open when you try to connect? When you run it with LocalMultiplayerAgent, it transitions the game server from StandingBy state to Active, after which it stays alive for a number of seconds, configurable in the settings JSON file.

Comment

People who like this

0 Show 5 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image itsjustnils · Jun 01 at 08:13 AM 0
Share

To be clear, the LocalMultiplayerAgent in process mode works perfectly for me. Once I deploy the build in process mode, I'm not able to connect.

avatar image itsjustnils · Jun 01 at 10:02 AM 0
Share

I've had another spin with the sample project you mentioned. LocalMultiplayerAgent-wise everything works out just fine.

When I deploy this server build (after making sure it runs automatically instead of having to press the "Server" button), I request a server to retrieve it's ip and port number, and again I'm unable to connect.

Is it possible one can only connect through another flow? Like using matchmaking (something I don't need for my specific project)?

avatar image itsjustnils · Jun 01 at 10:35 AM 0
Share

When did you do a hotfix XD. Now I can just connect with the same flow I've been trying the past 2 weeks!

avatar image Dimitris Gkanatsios itsjustnils · Jun 01 at 05:14 PM 0
Share

Glad that it's working for you. We didn't do any release today or yesterday, not sure what was going wrong. But to your question, if everything works great, you should be able to connect to the server with the values you get from the RequestMultiplayerServer API call. Matchmaking is *not* required.

avatar image itsjustnils Dimitris Gkanatsios · Jun 03 at 03:03 PM 1
Share

Thanks. Yes I'm still not sure why connecting to the server failed before. I've been working with several networking and hosting apis over the past weeks. Maybe I simply missed something because of it.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    13 People are following this question.

    avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges