Discard UDP packet

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Discard UDP packet

Postby janheuninck » 05 Apr 2012, 19:14

Hi guys,

I think I discovered a bug: When the first user, after a server restart, enters a game room, he gets the Id 0

Image

This doesn't give errors when the clients sends TCP messages to the server, but this error occurs when UDP messages are being sent:

Code: Select all

11:54:41,649 WARN  [SocketReader] protocol.SFSIoHandler     - Discard UDP packet from 127.0.0.1:60359, reason: User does not exist, id: -1


When the user disconnects, and reconnects again, the error is gone and everything works fine. Is this a bug or am I doing something wrong?


Cheers
Jan
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: Discard UDP packet

Postby A51Integrated » 05 Apr 2012, 19:27

Since that is on the server side, I'll have to pass this on to appropriate people. Let me see what we can do.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Discard UDP packet

Postby Lapo » 06 Apr 2012, 08:04

HI,
can you please explain the steps to see the problem described in action?
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Re: Discard UDP packet

Postby janheuninck » 19 Apr 2012, 20:49

Sorry for the late response, but I was on holiday.

The problem occurs the first time a user enters the game room and tries to send messages to the server via the UDP protocol. The server receives the messages, because it shows a warning for every message:

Code: Select all

11:54:41,649 WARN  [SocketReader] protocol.SFSIoHandler     - Discard UDP packet from 127.0.0.1:60359, reason: User does not exist, id: -1


The UDP protocol works fine though if messages are sent from the server to the client. The error disappears if the user disconnects and connects (and enters the room) again. The problem only occurs the very first time a client joins the room after a server restart.

This is the code I use to connect to a room and send UDP packages:

Code: Select all

- (void)onLogin:(SFSEvent *)evt
{
    // Initialize the UDP socket
    [smartFox initUDP:nil:-1];
}


Code: Select all

- (void)joinRoom:(NSString *)room
{
    [smartFox send:[JoinRoomRequest requestWithId:room]];
}


Code: Select all

- (void)send:(NSString *)msg useUDP:(BOOL)useUDP
{   
    // Create SFS Data object
    id data = [[SFSObject newInstance] autorelease];
   
    // Store data in SFS Data object
    // ...
   
    // Send via SFS
    [smartFox send:[ExtensionRequest requestWithExtCmd:CMD params:data room:[smartFox lastJoinedRoom] udp:useUDP]];
}


More logs:

Code: Select all

13:56:15,914 INFO  [main] v2.SmartFoxServer     - 
 _____ _____ _____    ___ __ __
|   __|   __|   __|  |_  |  |  |
|__   |   __|__   |  |  _|-   -|
|_____|__|  |_____|  |___|__|__|                                         
 _____ _____ _____ ____  __ __
| __  |   __|  _  |    \|  |  |
|    -|   __|     |  |  |_   _|
|__|__|_____|__|__|____/  |_| 
[ 2.0.1 ]

13:56:15,916 INFO  [main] v2.SmartFoxServer     - SmartFoxServer 2X (2.0.1) READY!
13:56:18,286 INFO  [SocketReader] core.SocketAcceptor     - Session created: { Id: 1, Type: DEFAULT, Logged: No, IP: 192.168.100.68:63807 } on Server port: 9933 <---> 63807
13:56:19,568 INFO  [pool-1-thread-3] api.SFSApi     - Login in, { Zone: LF }, ( User Name: jonas, Id: 0, Priv: 0, Sess: 192.168.100.68:63807 )
13:56:22,839 WARN  [SocketReader] protocol.SFSIoHandler     - Discard UDP packet from 192.168.100.68:49603, reason: User does not exist, id: -1
13:56:22,867 WARN  [SocketReader] protocol.SFSIoHandler     - Discard UDP packet from 192.168.100.68:49603, reason: User does not exist, id: -1
13:56:22,918 WARN  [SocketReader] protocol.SFSIoHandler     - Discard UDP packet from 192.168.100.68:49603, reason: User does not exist, id: -1
13:56:22,976 WARN  [SocketReader] protocol.SFSIoHandler     - Discard UDP packet from 192.168.100.68:49603, reason: User does not exist, id: -1
13:56:23,189 WARN  [SocketReader] protocol.SFSIoHandler     - Discard UDP packet from 192.168.100.68:49603, reason: User does not exist, id: -1
13:56:28,683 INFO  [SocketReader] sessions.DefaultSessionManager     - Session removed: { Id: 1, Type: DEFAULT, Logged: Yes, IP: 192.168.100.68:63807 }
13:56:28,684 INFO  [SocketReader] entities.SFSZone     - User: jonas was disconnected.
13:56:28,685 INFO  [SocketReader] api.SFSApi     - User disconnected: ( User Name: jonas, Id: 0, Priv: 0, Sess: 192.168.100.68:63807 )


It looks like the ports aren't the same (63807 <-> 49603)
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: Discard UDP packet

Postby A51Integrated » 23 Apr 2012, 15:42

We have verified that this is a bug in the iOS API and the issue has been fixed. It will be included in the next release. Thanks for reporting.
A51 Integrated

http://a51integrated.com / +1 416-703-2300
User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Re: Discard UDP packet

Postby janheuninck » 11 May 2012, 02:50

Any idea when you will release the new API that fixes this issue?


Thanks
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: Discard UDP packet

Postby A51Integrated » 11 May 2012, 19:21

Sorry, no release date yet. We're waiting for a more substantial number of fixes to release a new version.
A51 Integrated

http://a51integrated.com / +1 416-703-2300
Fellow
Posts: 10
Joined: 29 Feb 2012, 17:29

Re: Discard UDP packet

Postby Fellow » 16 May 2012, 02:02

Hi,

I have been following this discussing since Jan posted it. I have the same problem. It's really annoying because I have to restart my SFServer all the time.
Could you release a next version of the OSX API in the near future? This bug has been reported on the 5th of April (almost a month and a half ago).
This subforum is not very active, there are not a lot of users that are posting bugs. If I have to wait for users to report bugs, I could be waiting for a very long time.

Thanks.
Jonas
User avatar
Bax
Site Admin
Posts: 4610
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Discard UDP packet

Postby Bax » 21 May 2012, 10:46

The bug was fixed. A new version of the API can be downloaded here: http://www.smartfoxserver.com/download/sfs2x#p=updates (v1.0.5)
Paolo Bax
The SmartFoxServer Team
User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Re: Discard UDP packet

Postby janheuninck » 21 May 2012, 15:59

Bax wrote:The bug was fixed. A new version of the API can be downloaded here: http://www.smartfoxserver.com/download/sfs2x#p=updates (v1.0.5)


Thanks, but it appears it is still version 1.0.4 that gets downloaded: SFS2X_API_ObjectiveC_v1.0.4
User avatar
Bax
Site Admin
Posts: 4610
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Discard UDP packet

Postby Bax » 21 May 2012, 16:18

Sorry. Now it is fixed.
Paolo Bax
The SmartFoxServer Team
shanti
Posts: 45
Joined: 19 Jul 2011, 10:19

Re: Discard UDP packet

Postby shanti » 08 Jun 2012, 07:03

Hello,

We are using SFS2X version 2.0.1 and we are also facing Discard UDP packet issue. So I got to know from this post that it is fixed in this patch, downloaded the new patch from
http://www.smartfoxserver.com/download/sfs2x#p=updates
Installed the patch in a linux server (followed steps as instructed in the release notes).
After installing, restarted MMO server and tried connecting to it from a test app. It is not connecting and gives below error -
SocketPolicyClient1: Incoming GetPolicyStreamForIP
SocketPolicyClient1: About to BeginConnect to XXX.XXX.X.XX:9933
SocketPolicyClient1: About to WaitOne
SocketPolicyClient1: Socket connected
[SFS - ERROR] ## BlueBox Error: Invalid http session !
[SFS - ERROR] TCPSocketLayer: Connection closed by the remote side
Environments used –
Server – Linux Redhat
Client – Unity 3.5.2f2
After this error it will never reconnects again. What other settings do we need? How do I resolve this issue? We need to fix UDP discard packet issue.

Thanks in advance
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: Discard UDP packet

Postby A51Integrated » 08 Jun 2012, 13:38

The fix mentioned in this thread was for the iOS API - not the server itself. Try posting in the Unity / .NET forum and make sure you're using the latest client API as well.
A51 Integrated

http://a51integrated.com / +1 416-703-2300

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 16 guests