Difference between SessionName and ServerName

In the course we made variable MySessionName = FName(“Co-op Adventure Session Name”) and we also have delegate variable ServerName.

Can someone explain to me difference between session name and server name when we create/join sessions?
What’s the purpose of each variable?
Can session name be the same as server name or they should be different?
Why do we have to deal with to IMO similar variables?
Why don’t we use

SessionInterface->CreateSession(0, ServerName, SessionSettings)

instead of

SessionInterface->CreateSession(0, MySessionName, SessionSettings)


Couldn’t find any helpful information in google, so I would really appreciate if someone could help me or give a link to a documentation.

Hi and welcome to the community.

Connecting to a server would imply you are joining or creating a session on a server. What is covered here is joining a session between 2 or more computers on a lan. In this case, you are creating a session locally, others will join and it is then that you use the server name.

So, you create the session on one of the clients and the others who then join use this server name to find the session.

So session name is used to create session on a local computer and then we use server name on a global scale to connect to the session via internet, right?

Does that mean that for one machine I have to have unique session name for each game instance?
i.e. I’m trying to launch two separate instances of the game and create sessions in each of them, do I have to create different session names for them or it doesn’t matter in this case?

The server name is still relevant on a local network, ie. two computers on same network. Also, only the server has the session and other clients join that session.

So, when you run locally, one of the instances is a client and a server, so it has an address and you create a session, for any other machine joining, you give them the server name (ip address maybe) and it enables them to connect and join the session.

There should be a single session for a group of clients interacting together and one will typically be the one creating the session and acting as a server while others will use the server name to join.

This is covered in one of the lectures in the course.

I apologise if I’m not explaining it clearly.

Edit: The client that is also the server automatically joins the server.

I do get that only server is the owner of the session and all the clients join it.

In my previous question what I meant was: if I launch two separate instances of the game on one machine (only for test purposes) and then create sessions on each instance with the same session name (I’m not trying to make them connect), shouldn’t that make them conflict each other, since in the lecture we essentialy hardcoded session name to “Co-op Adventure Session Name”?

I guess, what I am trying to understand is: why do we have to name session at all? Why dont we just use only the Server Name if we want to allow connections?

Thank you for your replies.

Oh. Ok. That makes more sense. Absolutely they would conflict. Not just in name but you’d potentially have port issues as well. The server would be created on a different port so not only would clients need the address but also the port. I think this is covered or rather addressed by enabling entry of server when joining later in the course. It is possible it might work with the Null OSS but it wouldn’t be a clever or sensible thing to do.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms