Disconnect Users With Incorrect UDP Port

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Vcrn
Posts: 29
Joined: 11 Apr 2017, 00:31

Disconnect Users With Incorrect UDP Port

Postby Vcrn » 11 Apr 2017, 00:37

An issue I've been having on my server is this message which happens occasionally:

Code: Select all

Discard UDP packet from 191.216.83.48:58709, reason: Sender UDP Port doesn't match current session port: 58709 != 58027


Since my game uses UDP for position updates, other players aren't able to see players with this mismatch, which has game-breaking effects. From what I can tell reading other users' posts is that this is probably caused by firewall/mobile carrier issues.

Since this has a big impact on gameplay, is it possible to catch the warning and disconnect the user so they can try to reconnect properly?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Disconnect Users With Incorrect UDP Port

Postby Lapo » 11 Apr 2017, 07:45

Hi,
we don't have such event available, but we could add it if it helps.

Instead of disconnecting it would probably be best to switch to TCP, since the problem won't go away by reconnecting.
Lapo
--
gotoAndPlay()
...addicted to flash games
Vcrn
Posts: 29
Joined: 11 Apr 2017, 00:31

Re: Disconnect Users With Incorrect UDP Port

Postby Vcrn » 11 Apr 2017, 11:46

Lapo wrote:Hi,
we don't have such event available, but we could add it if it helps.

Instead of disconnecting it would probably be best to switch to TCP, since the problem won't go away by reconnecting.


The game currently sends 10 UDP messages per second, and can send up to 10 TCP messages per second. Would SFS be able to handle up to 20 TCP messages per second?
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Disconnect Users With Incorrect UDP Port

Postby meanvel » 11 Apr 2017, 12:39

I was reading that most cell phone carriers did not allow UDP...

Has this changed in recent years?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Disconnect Users With Incorrect UDP Port

Postby Lapo » 11 Apr 2017, 15:20

Vcrn wrote:
Lapo wrote:Hi,
we don't have such event available, but we could add it if it helps.

Instead of disconnecting it would probably be best to switch to TCP, since the problem won't go away by reconnecting.


The game currently sends 10 UDP messages per second, and can send up to 10 TCP messages per second. Would SFS be able to handle up to 20 TCP messages per second?

It can handle even 200 or 2000 :) The problem is not SmartFoxServer, the problem is the network. If you have super low latency you can send as many as you need.

Anyways 20 messages/sec is still feasible in most cases.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Disconnect Users With Incorrect UDP Port

Postby Lapo » 11 Apr 2017, 15:21

meanvel wrote:I was reading that most cell phone carriers did not allow UDP...

Has this changed in recent years?

Not much unfortunately ... maybe a little :?
Lapo

--

gotoAndPlay()

...addicted to flash games
Vcrn
Posts: 29
Joined: 11 Apr 2017, 00:31

Re: Disconnect Users With Incorrect UDP Port

Postby Vcrn » 11 Apr 2017, 15:42

Lapo wrote:
Vcrn wrote:
Lapo wrote:Hi,
we don't have such event available, but we could add it if it helps.

Instead of disconnecting it would probably be best to switch to TCP, since the problem won't go away by reconnecting.


The game currently sends 10 UDP messages per second, and can send up to 10 TCP messages per second. Would SFS be able to handle up to 20 TCP messages per second?

It can handle even 200 or 2000 :) The problem is not SmartFoxServer, the problem is the network. If you have super low latency you can send as many as you need.

Anyways 20 messages/sec is still feasible in most cases.

Cheers


Sorry I meant 20 TCP messages/second per client. Since it's a mobile game I'm not sure if that would be a performance bottleneck. The server is already sending well over 2000 messages/second without any issues (1% dropped packets).

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 100 guests