Page 1 of 2

Missing 'api' flag in Handshake Request

Posted: 01 Aug 2011, 18:29
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!

Posted: 03 Aug 2011, 09:03
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

Posted: 15 Aug 2011, 07:00
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.

Posted: 15 Aug 2011, 11:25
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

Posted: 16 Aug 2011, 03:13
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

Posted: 16 Aug 2011, 06:26
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?

Posted: 16 Aug 2011, 06:36
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

Posted: 16 Aug 2011, 06:52
by jacques.chen
What version of iOS are you testing with?
We use Xcode 3.2.5 and iOS 4.2

Jacques

Posted: 16 Aug 2011, 07:00
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?

Posted: 16 Aug 2011, 07:04
by jacques.chen
Hi~

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

Jacques

Posted: 16 Aug 2011, 07:06
by Lapo
PLEASE: Post the stack trace of the latest attempt you have done with SFS2X RC3 and related API.
Thanks!

Posted: 16 Aug 2011, 07:11
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

Posted: 16 Aug 2011, 07:17
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

Posted: 16 Aug 2011, 07:30
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

Posted: 16 Aug 2011, 08:21
by ThomasLund
thomas

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

/Thomas