Cant seem to make multiple Game session with diffrent Port

0

I have made a system to check available port that is not used, but i cant seem to make the gamesession use diffrent port from the previous one, any help i can get?

질문됨 4년 전225회 조회
10개 답변
0

I assume you are running multiple servers per instance. Each server should report in its ProcessReady call which port its listening on. This port send back here is then the port for each game session assigned to that server process.

So it sounds like instead of setting the server port via a game parameter in the run time configuration part of create-fleet, your servers are dynamically finding an open port in a given port range and using that?

In which case make sure you are setting the port as part of the ProcessParameters section of your ProcessReady call.

답변함 4년 전
0

hello pip sorry for the late reply i havent try it yet, but i have a quaestion does when we make there is 10 concurrent process, is there 10 server.exe on standby or each server.exe will be up only when it is needed

답변함 4년 전
0

GameLift will launch x copies of your server per instance based on your launch configuration. If you need more servers then it will scale up a new instance and launch x copies of your server etc.

That way your servers are always ready to host new game sessions.

You can control who many new game sessions get placed at anytime via MaxConcurrentGameSessionActivations to reduce peak load on your instance.

See https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-multiprocess.html

답변함 4년 전
0

does that mean processready() will only be called on the time i make a new game session?or will it be called when these 10 server is up?

답변함 4년 전
0

Hello pip i have try it but doesnt seem to amount any success, can u maybe point out anything wrong with my code ? REMOVEDUPLOAD

답변함 4년 전
0

Code looks ok, but I can't see how you are setting _port, thats the important part.

As for your earlier question, GameLift is going to launch 10 (if thats how many you've asked for) server processes roughly at the same time once the EC2 instance is ready.

Server process launch is async so they may not all launch exactly at the same time but they will be started close together. So you need to account for that if you are doing dynamic port allocation (ie randomly grab a port in your server range, see if its available for use, try another port until success.)

I would while troubleshooting, limit your servers to a few (ie 2-3) and prefer static port allocation via passed parameters from your runtime launch configuration. Once you've got a fleet working that way, its easier to make changes to get to your desired instance count/port allocation mechanism.

답변함 4년 전
0

Hello pip sorry from the late reply here is the snippet for setting the port

REMOVEDUPLOAD

답변함 4년 전
0

If there is a part that is wrong, it would be helpful to get some help/ pointing to the right direction

답변함 4년 전
0

helllo pip i still cant seem to get it working any help?

답변함 4년 전
0

@REDACTEDUSER

Things I would try:

  • If you are not, log the ports you pick per server and send in the ProcessReady parameters - ensure that your server processes are actually running on different ports. If not things will break.
  • simplify the problem and statically assign the ports via the runtime configuration. Ensure things are working outside of the dynamic port allocation model ie
ServerProcesses=[{LaunchPath='C:\game\MyGame.exe',Parameters=port 33435,ConcurrentExecutions=1},{LaunchPath='C:\game\MyGame.exe',Parameters=port 33436,ConcurrentExecutions=1}]"

Theres lots of ways of doing this sort of thing but you need to make it work for multiple executables launching roughly at the same time so you probably need to bind a socket / httplistener etc to the port to claim, or back off and try another port etc.

답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠