Missing 'api' flag in Handshake Request

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

Moderators: Lapo, Bax

jacques.chen
Posts: 27
Joined: 01 Aug 2011, 18:23

Missing 'api' flag in Handshake Request

Post by jacques.chen »

Hi~all

We use smartfoxserver 2X to be server for our iPhone game.
All connection tests through unity are ok.
But when build to iPhone, connection goes wrong.
We get error message "Missing 'api' flag in Handshake Request" in server log.
And following are some paragraphs in client console log.

================================================== ==================================================
Connect to X.X.X.X

(Filename: /Applications/buildAgent/work/71ca6fec1b41cc30/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2528)

Click 2P_Battle

(Filename: /Applications/buildAgent/work/71ca6fec1b41cc30/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2528)

[SFS - ERROR] TCPSocketLayer: Connection error: Connection refused at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0
[SmartFox] TCPSocketLayer: Connection error: Connection refused at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0

(Filename: /Applications/buildAgent/work/71ca6fec1b41cc30/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2528)

[SmartFox] TCPSocketLayer: Connection error: Connection refused at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0

(Filename: /Applications/buildAgent/work/71ca6fec1b41cc30/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2528)

[SmartFox] Connection error: Connection refused at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0 [ConnectionRefused]

(Filename: /Applications/buildAgent/work/71ca6fec1b41cc30/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2528)

[SmartFox] Connection error: Connection refused at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0 [ConnectionRefused]

(Filename: /Applications/buildAgent/work/71ca6fec1b41cc30/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2528)

================================================== ==================================================


We got no idea on how this happens.
Can you give us some suggestions? Or you need more information or log to help.

Many thanks!
Last edited by jacques.chen on 16 Aug 2011, 07:24, edited 1 time in total.
jacques.chen
Posts: 27
Joined: 01 Aug 2011, 18:23

Post by jacques.chen »

Hi~

We've excluded possible firewall blocking issues.

About the problem we met, "Missing 'api' flag in Handshake Request" in server log, we found relative info on SFS 2X online document.
http://docs2x.smartfoxserver.com/Dev...nnection-phase

In this page, there is an Connector example.
Because our game at last will be on iphone, and the server error message is "Missing 'api' flag in Handshake Request".
We are thinking if there are some special configuration or code need to be added or taken care so that this error will be solved in this Connection Phase?

Thanks!

Jacques
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

MOVED:
You have posted in the wrong section of the forum!

This is not an Objective-C question, it is related with Unity and C#
That's why you didn't get a reply last time.

My colleague Thomas will get back to you soon.
Meanwhile are you really sure you are using the latest API?? We are not aware of any problems like these. Please update to SFS2X RC3 and make sure to use the API from that distribution.
Lapo
--
gotoAndPlay()
...addicted to flash games
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Post by ThomasLund »

Definitely sounds like an old API in use.

I would suggest double checking that the dll used is latest from rc3 download.

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
jacques.chen
Posts: 27
Joined: 01 Aug 2011, 18:23

Post by jacques.chen »

Hello~Thomas

We checked and seems still not work.
I have some ideas for discussion.

The first is can we sign a mutual NDA and I shared our unity project to you to see if you can help?

The second is today we'll try to test on SFS 1.x or pro.
If problem solved, can we transfer our bought SFS 2X license (2000 users) to that ok version?

Maybe we can further talk to check some buy detail in pm if needed or any other info you need.


Many thanks for your help.
Our project has been stuck for a while. :(
Hope everything can be OK asap.

Jacques

Thanks
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Can you please keep posting the stack trace with the error? (both client and server side). We need to see what's going on, please.
What version of iOS are you testing with?
Lapo
--
gotoAndPlay()
...addicted to flash games
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Post by ThomasLund »

At one point in time (in our discussions earlier) it was my impression that you are using the objective-c API with a Unity project on top. Has that changed? Or did I misunderstand?

Anyways - I'd much rather have a super small reproduction build than anything that requires NDAs and getting complete game projects. Not because I dont want to sign a NDA, but because I dont want 6 gb projects to fix (hopefully) 1 line of error.

/T
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
jacques.chen
Posts: 27
Joined: 01 Aug 2011, 18:23

Post by jacques.chen »

What version of iOS are you testing with?
We use Xcode 3.2.5 and iOS 4.2

Jacques
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

XCode? :shock:
Code is in C#, right? I guess we're talking about Unity3D. So maybe what version of unity do you use?
Lapo
--
gotoAndPlay()
...addicted to flash games
jacques.chen
Posts: 27
Joined: 01 Aug 2011, 18:23

Post by jacques.chen »

Hi~

We use Unity 3.1.0f4 but we tried latest 3.4 and problem still there.

Jacques
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

PLEASE: Post the stack trace of the latest attempt you have done with SFS2X RC3 and related API.
Thanks!
Lapo
--
gotoAndPlay()
...addicted to flash games
jacques.chen
Posts: 27
Joined: 01 Aug 2011, 18:23

Post by jacques.chen »

ThomasLund wrote:At one point in time (in our discussions earlier) it was my impression that you are using the objective-c API with a Unity project on top. Has that changed? Or did I misunderstand?

Anyways - I'd much rather have a super small reproduction build than anything that requires NDAs and getting complete game projects. Not because I dont want to sign a NDA, but because I dont want 6 gb projects to fix (hopefully) 1 line of error.

/T
We use Unity and C#

How to send you the simple smaller reproduction project? (e-mail or?)And you need to know our server info so that you can check from there?

Jacques
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Post by ThomasLund »

Email is fine!

As this seems to be solely connection related, I only need a small repro case with the connection part in it - no need to run against your server. I can do that locally here to see it connects (and you actually in your first posting have the server ip - might want to remove that)

Did you try to run the basic connection test and/or lobby tutorial on your iOS device? Did you compare the code to your connection code?

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
jacques.chen
Posts: 27
Joined: 01 Aug 2011, 18:23

Post by jacques.chen »

ThomasLund wrote:Email is fine!

As this seems to be solely connection related, I only need a small repro case with the connection part in it - no need to run against your server. I can do that locally here to see it connects (and you actually in your first posting have the server ip - might want to remove that)

Did you try to run the basic connection test and/or lobby tutorial on your iOS device? Did you compare the code to your connection code?

/Thomas
Excuse me that I can't find your e-mail or just send to support@smartfoxserver.com

I think we did what we can as my the other post.
http://forums.smartfoxserver.com/viewtopic.php?t=10224


Jacques
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Post by ThomasLund »

thomas

and then you can add the @ with a fullcontrol.dk to it (attempt at anti-spam robots grabbing my email) :-)

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
Post Reply