send UDP request lost

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

hhd90
Posts: 67
Joined: 21 Dec 2012, 05:17

send UDP request lost

Postby hhd90 » 17 May 2014, 04:34

I have a problem with UDP request, sometime i send UDP request success in client side, but server side don't receive that request, although I try to send a lot of requests then , but the server has not received any request. I have to disconnect and reconnect to send request. What's the problem?
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: send UDP request lost

Postby Lapo » 19 May 2014, 08:23

Hi,
please, check the server side logs and see if there're related errors.

Also specify which server version and client API version you're using.

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
hhd90
Posts: 67
Joined: 21 Dec 2012, 05:17

Re: send UDP request lost

Postby hhd90 » 21 May 2014, 02:54

Cause of the error is due to be changed to UDP port:

Code: Select all

20 May 2014 | 14:22:09,123 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 71, Type: DEFAULT, Logged: No, IP: 117.6.79.157:45974 } on Server port: 9933 <---> 45974
20 May 2014 | 14:22:09,180 | INFO  | pool-1-thread-4 | v2.api.SFSApi |     | User login: { Zone: CardGameZone }, ( User Name: mrgru, Id: 70, Priv: 0, Sess: 117.6.79.157:45974 ) , Type: Android
20 May 2014 | 14:22:09,226 | INFO  | com.smartfoxserver.v2.controllers.SystemController-10 | v2.api.SFSApi |     | Room joined: [ Room: The Lobby, Id: 0, Group: default, isGame: false ], { Zone: CardGameZone }, ( User Name: mrgru, Id: 70, Priv: 0, Sess: 117.6.79.157:45974 ) , asSpect: false
20 May 2014 | 14:22:14,447 | INFO  | com.smartfoxserver.v2.controllers.SystemController-1 | v2.api.SFSApi |     | Room joined: [ Room: Sam_3_1, Id: 671, Group: Sam_3, isGame: true ], { Zone: CardGameZone }, ( User Name: mrgru, Id: 70, Priv: 0, Sess: 117.6.79.157:45974 ) , asSpect: false
20 May 2014 | 14:22:43,008 | INFO  | com.smartfoxserver.v2.controllers.SystemController-2 | v2.api.SFSApi |     | Room joined: [ Room: The Lobby, Id: 0, Group: default, isGame: false ], { Zone: CardGameZone }, ( User Name: manh, Id: 55, Priv: 0, Sess: 113.187.0.83:19202 ) , asSpect: false
20 May 2014 | 14:22:47,030 | INFO  | com.smartfoxserver.v2.controllers.SystemController-3 | v2.api.SFSApi |     | Room joined: [ Room: Lieng_1_1, Id: 541, Group: Lieng_1, isGame: true ], { Zone: CardGameZone }, ( User Name: manh, Id: 55, Priv: 0, Sess: 113.187.0.83:19202 ) , asSpect: false
20 May 2014 | 14:22:47,154 | WARN  | DatagramReader | v2.protocol.SFSIoHandler |     | Discard UDP packet from 113.187.0.83:8638, reason: Sender UDP Port doesn't match current session port: 8638 != 11454
20 May 2014 | 14:22:53,864 | INFO  | com.smartfoxserver.v2.controllers.SystemController-4 | v2.api.SFSApi |     | Room joined: [ Room: Lieng_1_1, Id: 541, Group: Lieng_1, isGame: true ], { Zone: CardGameZone }, ( User Name: manh, Id: 55, Priv: 0, Sess: 113.187.0.83:19202 ) , asSpect: false
20 May 2014 | 14:22:53,988 | WARN  | DatagramReader | v2.protocol.SFSIoHandler |     | Discard UDP packet from 113.187.0.83:8638, reason: Sender UDP Port doesn't match current session port: 8638 != 11454
20 May 2014 | 14:23:06,049 | INFO  | com.smartfoxserver.v2.controllers.SystemController-5 | v2.api.SFSApi |     | Room joined: [ Room: Lieng_1_1, Id: 541, Group: Lieng_1, isGame: true ], { Zone: CardGameZone }, ( User Name: manh, Id: 55, Priv: 0, Sess: 113.187.0.83:19202 ) , asSpect: false
20 May 2014 | 14:23:06,159 | WARN  | DatagramReader | v2.protocol.SFSIoHandler |     | Discard UDP packet from 113.187.0.83:8638, reason: Sender UDP Port doesn't match current session port: 8638 != 11454
20 May 2014 | 14:23:11,911 | INFO  | com.smartfoxserver.v2.controllers.SystemController-6 | v2.api.SFSApi |     | Room joined: [ Room: The Lobby, Id: 0, Group: default, isGame: false ], { Zone: CardGameZone }, ( User Name: manh, Id: 55, Priv: 0, Sess: 113.187.0.83:19202 ) , asSpect: false
20 May 2014 | 14:23:13,114 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 56, Type: DEFAULT, Logged: Yes, IP: 113.187.0.83:19202 }
20 May 2014 | 14:23:13,114 | INFO  | SocketReader | v2.entities.SFSZone |     | User: manh was disconnected.
20 May 2014 | 14:23:13,115 | INFO  | SocketReader | v2.api.SFSApi |     | User disconnected: { Zone: CardGameZone }, ( User Name: manh, Id: 55, Priv: 0, Sess: 113.187.0.83:19202 ) , SessionLen: 602199, Type: Android
20 May 2014 | 14:24:02,314 | WARN  | com.smartfoxserver.v2.controllers.ExtensionController-2 | v2.controllers.ExtensionController |     | com.smartfoxserver.v2.exceptions.SFSExtensionException: User cannot invoke Room extension if he's not joined in that Room. ( User Name: chau3, Id: 17, Priv: 0, Sess: 117.6.79.157:57550 ) , [ Room: Sam_3_1, Id: 671, Group: Sam_3, isGame: true ]
com.smartfoxserver.v2.controllers.ExtensionController.processRequest(ExtensionController.java:114)
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: send UDP request lost

Postby Lapo » 21 May 2014, 07:54

Yes, if the UDP port is changed suddenly during a user session the server will complain.
UDP is a connection-less protocol so the UDP address and port are used to identify the transmitting user. The server does not allow clients to change their port in the middle of a conversation, if it did an attacker could use this as a way to spoof the identity of the user and act on his behalf.

Is this happening on a mobile phone? I ask because there can be carriers that allow dynamic re-allocation of UDP ports, making it impossible to establish a secure communication.
Lapo

--

gotoAndPlay()

...addicted to flash games
hhd90
Posts: 67
Joined: 21 Dec 2012, 05:17

Re: send UDP request lost

Postby hhd90 » 21 May 2014, 08:45

Yes, this happen on the mobile. What's your solution for this problem ?
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: send UDP request lost

Postby Lapo » 21 May 2014, 09:17

There might be a workaround, as suggested here:
http://stackoverflow.com/questions/4106 ... connection

But the real problem is the poor implementation on the side of the mobile carrier.
Let me know if the above helps.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 45 guests