# Default BeaconListenPort is not used due to invalid logic in FOnlineSessionNull

**URL:** <https://forums.unrealengine.com/t/default-beaconlistenport-is-not-used-due-to-invalid-logic-in-fonlinesessionnull/302562>\
**Category:** Multiplayer & Networking\
**Tags:** logic, unreal-engine, question\
**Created:** [December 28, 2014, 7:39am UTC](https://forums.unrealengine.com/t/default-beaconlistenport-is-not-used-due-to-invalid-logic-in-fonlinesessionnull/302562 "2014-12-28T07:39:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kory](https://forums.unrealengine.com/u/Kory)\
**Post date:** [December 28, 2014, 7:39am UTC](https://forums.unrealengine.com/t/default-beaconlistenport-is-not-used-due-to-invalid-logic-in-fonlinesessionnull/302562/1 "2014-12-28T07:39:23Z")

</div>

Please see comments in code below where I point out error in logic.

```
bool FOnlineSessionNull::GetResolvedConnectString(const class FOnlineSessionSearchResult& SearchResult, FName PortType, FString& ConnectInfo)
{
	bool bSuccess = false;
	if (SearchResult.Session.SessionInfo.IsValid())
	{
		TSharedPtr<FOnlineSessionInfoNull> SessionInfo = StaticCastSharedPtr<FOnlineSessionInfoNull>(SearchResult.Session.SessionInfo);

		if (PortType == BeaconPort)
		{

```

Notice default port here is 15000

```
			int32 BeaconListenPort = 15000;
			if (SearchResult.Session.SessionSettings.Get(SETTING_BEACONPORT, BeaconListenPort) && BeaconListenPort > 0)
			{

```

But if statement above uses && instead of || so default never gets used if SETTING\_BEACONPORT has not been set.

```
				bSuccess = GetConnectStringFromSessionInfo(SessionInfo, ConnectInfo, BeaconListenPort);
			}
		}
		else if (PortType == GamePort)
		{
			bSuccess = GetConnectStringFromSessionInfo(SessionInfo, ConnectInfo);
		}
	}
	
	if (!bSuccess || ConnectInfo.IsEmpty())
	{
		UE_LOG_ONLINE(Warning, TEXT("Invalid session info in search result to GetResolvedConnectString()"));
	}

	return bSuccess;
}

```

This one should be a simple fix of changing && to ||. Thanks guys!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [December 31, 2014, 9:59pm UTC](https://forums.unrealengine.com/t/default-beaconlistenport-is-not-used-due-to-invalid-logic-in-fonlinesessionnull/302562/2 "2014-12-31T21:59:04Z")

</div>

Hi ,

Thank you for pointing this out to us. I have submitted a report about this to have it investigated further (UE-7088).

---

<div class="post-metadata">

**Author:** ![HailstoneRyan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HailstoneRyan](https://forums.unrealengine.com/u/HailstoneRyan)\
**Post date:** [November 12, 2015, 10:27pm UTC](https://forums.unrealengine.com/t/default-beaconlistenport-is-not-used-due-to-invalid-logic-in-fonlinesessionnull/302562/3 "2015-11-12T22:27:18Z")

</div>

I hate to bring up an old topic, especially one almost a year old, but was anything determined regarding this? I notice this line of code still exists and I’ll happily edit it but I want to ensure that that is accepted answer.

---

<div class="post-metadata">

**Author:** ![Kory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kory](https://forums.unrealengine.com/u/Kory)\
**Post date:** [November 13, 2015, 6:05am UTC](https://forums.unrealengine.com/t/default-beaconlistenport-is-not-used-due-to-invalid-logic-in-fonlinesessionnull/302562/4 "2015-11-13T06:05:24Z")

</div>

You know it’s funny, I was just looking at this line of code again about a month ago and was thinking same thing. It seems like best way to get it integrated is to do a pull request nowadays. But I just don’t have time to do that right now. I’ve been working 80-90 hours a week so that we are ready for steam. I hope they fix it soon as I’m sure many others encounter this issues as well.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33800a51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33800a51](https://forums.unrealengine.com/u/anonymous_user_33800a51)\
**Post date:** [November 13, 2015, 4:18pm UTC](https://forums.unrealengine.com/t/default-beaconlistenport-is-not-used-due-to-invalid-logic-in-fonlinesessionnull/302562/5 "2015-11-13T16:18:32Z")

</div>

Hi all,

There hasn’t been an update on bug report at this time. We’ll post here once we see any change. If you do create a pull request, let us know and we’ll link reports. Thanks!

---

<div class="post-metadata">

**Author:** ![Kory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kory](https://forums.unrealengine.com/u/Kory)\
**Post date:** [November 14, 2015, 3:52pm UTC](https://forums.unrealengine.com/t/default-beaconlistenport-is-not-used-due-to-invalid-logic-in-fonlinesessionnull/302562/6 "2015-11-14T15:52:34Z")

</div>

[https://github.com/EpicGames/UnrealEngine/pull/1759](https://github.com/EpicGames/UnrealEngine/pull/1759)

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [November 16, 2015, 6:17pm UTC](https://forums.unrealengine.com/t/default-beaconlistenport-is-not-used-due-to-invalid-logic-in-fonlinesessionnull/302562/7 "2015-11-16T18:17:14Z")

</div>

Sorry guys, I never saw this thread or it wasn’t assigned properly. I’ll be working on getting this submitted today.

---

<div class="post-metadata">

**Author:** ![Kory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kory](https://forums.unrealengine.com/u/Kory)\
**Post date:** [November 16, 2015, 6:56pm UTC](https://forums.unrealengine.com/t/default-beaconlistenport-is-not-used-due-to-invalid-logic-in-fonlinesessionnull/302562/8 "2015-11-16T18:56:47Z")

</div>

[https://github.com/EpicGames/UnrealEngine/pull/1759](https://github.com/EpicGames/UnrealEngine/pull/1759)

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [November 16, 2015, 9:35pm UTC](https://forums.unrealengine.com/t/default-beaconlistenport-is-not-used-due-to-invalid-logic-in-fonlinesessionnull/302562/9 "2015-11-16T21:35:58Z")

</div>

Thanks for submission, I added code to Steam as well. CL#2768532 in one of our streams, it will make its way into mainline shortly.
