Connect problem when first enable 3G on iOS device

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Bax, Lapo

Connect problem when first enable 3G on iOS device

Postby beannt » 19 Feb 2013, 04:42

Hi,

I have a problem with Unity-iOS client. I have tested on lastest 1.0.7 Unity SFS client, Unity3D 4.0.1, and lastest 2.6 SFS server.

The reproduce case:
- Turn off all network connection from iOS device (iphone 3gs, iphone 5)
- Just enable 3G connection only
- Enter the game and connect to the server
- Exception in the log => BUG 1
[SFS - ERROR] TCPSocketLayer: General error reading data from socket: Read failure at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.Read () [0x00000] in <filename unknown>:0

- SFS will try BLUEBOX connection
[SFS - DEBUG] [ BB-Connect ]: http://xxx.xxx.xxx.xxx:8080/BlueBox/BlueBox.do

- Server check password using checkSecurePassword method
- Server reject login by invalid password => BUG 2

- > I think the exception in socket causes the session of BLUEBOX become invalid, so there are maybe 2 separated bugs
BUG 1: Can not use socket connection when first enable 3G (after switch to WIFI and back to 3G the connection is fine)
BUG 2: The socket exception cause BLUEBOX connection failed on password verifying. (When I force BLUEBOX connection by entering invalid socket port, the login is OK - that mean the password is right)

Thanks,
beannt
 
Posts: 4
Joined: 16 Feb 2013, 15:23

Re: Connect problem when first enable 3G on iOS device

Postby beannt » 22 Feb 2013, 14:40

Is there any feedbacks ? Has any one seen those bugs before ?
beannt
 
Posts: 4
Joined: 16 Feb 2013, 15:23

Re: Connect problem when first enable 3G on iOS device

Postby Lapo » 26 Feb 2013, 11:29

Hi,
sorry for the delay, Thomas hasn't been able to monitor this forum in the last weeks.

From your report it seems like with the 3G connectivity active you are not able to connect via socket, therefore the API attempt to use the BlueBox (HTTP) connection. The second part I don't understand. The password verification is not dependent in any way, shape or form to the connection.

Both bugs seem to depend on specific OS-related issues, more than anything else. It seems that the switching of connections is causing the issue.

It is quite difficult to debug things like these because the just show up on one of the OSes supported by Unity.
My suggestion is to check the latest updates from Unity and ask their support if they are aware of these networking issues in the iOS native compiler.
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Lapo
Site Admin
 
Posts: 16027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Connect problem when first enable 3G on iOS device

Postby beannt » 28 Feb 2013, 21:34

Hi,

Thanks for your response. I think 2 bugs are come from the bug in 3G connection, because after the connection from 3G failed, I can't verify the user password using built-in method (checkSecurePassword). The BLUEBOX connection takes place right after the failure of 3G connection automatically by SFS Unity client ( I had not switched to wifi yet ).

My first test case:
- First open 3G connection
- The socket failed with reading exception
- Smartfox client try connect through BLUEBOX (automatically)
- Server verify password return failed.

My second test case:
With the same user + password, but I change the socket port to an arbitrary invalid port
- First open 3G connection
- The socket failed because server can not be reach (invalid port setting)
- Smartfox try connect through BLUEBOX
- Server verify password success.

My workaround solution for BLUEBOX bug
- Do not use the checkSecurePassword method and check the password by my own method. This is not perfect but okay, hope this will help others as well.

Thanks,
beannt
 
Posts: 4
Joined: 16 Feb 2013, 15:23

Re: Connect problem when first enable 3G on iOS device

Postby Lapo » 28 Feb 2013, 22:49

There's one thing I don't understand.
The client is anyways sending an encrypted login, so how do you handle the password check? If you bypass the checkSecureLogin() ?
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Lapo
Site Admin
 
Posts: 16027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Connect problem when first enable 3G on iOS device

Postby beannt » 13 Mar 2013, 05:53

Sorry for late reply, I didn't come back to the forum for a while.

About the question, I use less secured login method by hashing the user password and send to the server via addition login parameters. In the server, I compare the hashed password from client with the one from database. I know this method is less secured than the built-in method, but this is the only thing I can do.
beannt
 
Posts: 4
Joined: 16 Feb 2013, 15:23


Return to SFS2X C# API

Who is online

Users browsing this forum: No registered users and 1 guest