IPv6 support

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

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

Re: IPv6 support

Postby Lapo » 16 Aug 2016, 06:40

nepoez wrote:
P.S. What do you think about the realtime performance Smartfox 2X compared to ElectroTank(which is gone now, reason for me to look into SmartFox)

I honestly have no idea. For more on SFS2X performance we have several papers here:
http://docs2x.smartfoxserver.com/Overview/white-papers

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
andersemil
Posts: 10
Joined: 19 Nov 2015, 14:11
Location: Copenhagen, Denmark

Re: IPv6 support

Postby andersemil » 31 Aug 2016, 06:17

We have been rejected by Apple because our Unity smartfox client wont connect on IPv6 network. I've made sure we connect to a domain, not an IPv4 address - and added the '::' binding in server.xml and restarted daemon but this made no difference. The exception i'm getting from smartfox client:

Code: Select all

[SFS - ERROR] [TCPSocketLayer] Connection error: Access denied   at System.Net.Sockets.Socket.Connect (System.Net.IPAddress[] addresses, Int32 port) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0
[SFS - ERROR] ## BlueBox Error: Http error creating http connection: System.Net.Sockets.SocketException: Access denied
  at System.Net.Sockets.Socket.Connect (System.Net.IPAddress[] addresses, Int32 port) [0x00000] in <filename unknown>:0
  at Sfs2X.Http.SFSWebClient.UploadValuesAsync (System.Uri uri, System.String paramName, System.String encodedData) [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.BBox.BBClient.Connect (System.String host, Int32 port) [0x00000] in <filename unknown>:0
  at Sfs2X.SmartFox.HandleConnectionProblem (Sfs2X.Core.BaseEvent e) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.EventDispatcher.DispatchEvent (Sfs2X.Core.BaseEvent evt) [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.BitSwarmClient.OnSocketError (System.String message, SocketError se) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.Sockets.TCPSocketLayer.HandleErrorCallback (System.Object state) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.ThreadManager.InThread () [0x00000] in <filename unknown>:0
SFS Connection failed; is the server running at all?
SmartfoxClient:OnConnection(BaseEvent)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()


I have no idea how IPv6 works but when I get access denied I would expect that the client is able to contact the server but the server rejects the client for some reason? Can you help us? TIA
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 31 Aug 2016, 07:27

andersemil, did you follow the testing guidelines from Apple as described at the top of this post (test case 3)?
I suggest to replicate our test with our example, to make sure your environment is configured appropriately.
Then you can test your project to make sure it works under the same setup.
Of course make sure you are using the latest C# API available n our website (v1.6.5).
Paolo Bax
The SmartFoxServer Team
andersemil
Posts: 10
Joined: 19 Nov 2015, 14:11
Location: Copenhagen, Denmark

Re: IPv6 support

Postby andersemil » 31 Aug 2016, 08:08

Yes I followed the testing guideline from developer.apple.com, I created a NAT64 wifi network sharing and our app is able to contact our server via WWW, however the smartfox client fails to connect to the same server.
However, I just discovered that we are using the API v1.6.0. Do you think upgrading to 1.6.5 will solve the issue?
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 31 Aug 2016, 08:29

That's mandatory. IPv6 support is available starting from API v1.6.5.
Paolo Bax
The SmartFoxServer Team
andersemil
Posts: 10
Joined: 19 Nov 2015, 14:11
Location: Copenhagen, Denmark

Re: IPv6 support

Postby andersemil » 31 Aug 2016, 08:34

Thanks. I upgraded to 1.6.5 and now it works.
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 31 Aug 2016, 08:55

jack90 wrote:First, I call SFSConnection::connectToServer to connect socket server.
When Connection is Successful, I received SFSConnection::OnSmartFoxConnection. Here, I call login server with SFSConnection::loginTest().
Case 1: Device connect IPv4 -> SFSConnection::OnSmartFoxLogin or SFSConnection::OnSmartFoxLoginError will be called. -> OK
Case 2: Device connect IPv6 -> Silent, I don't receive anything.

Please give me ideas.
Thanks!

We repeated test 3 using C++ API v1.6.4 in a Xcode project targeted at iOS devices, and we can confirm everything works as expected.
We can send you our test project if you like. Contact us by email.
Paolo Bax
The SmartFoxServer Team
Tatanan
Posts: 112
Joined: 07 Jan 2014, 12:12
Contact:

Re: IPv6 support

Postby Tatanan » 01 Sep 2016, 08:46

Hi
I have added to server.xml file

Code: Select all

<socket address="::" port="9933" type="TCP"/>
<socket address="0:0:0:0:0:0:0:0" port="9933" type="TCP"/>


but I still can not connect though NAT64. I boot log prompt this error: Was not able to bind socket: { 0:0:0:0:0:0:0:0:9933, (Tcp) }

What can I do to fix it?

thanks.
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 01 Sep 2016, 09:29

Tatanan wrote:Hi
I have added to server.xml file

Code: Select all

<socket address="::" port="9933" type="TCP"/>
<socket address="0:0:0:0:0:0:0:0" port="9933" type="TCP"/>

but I still can not connect though NAT64. I boot log prompt this error: Was not able to bind socket: { 0:0:0:0:0:0:0:0:9933, (Tcp) }
What can I do to fix it?
thanks.

Are you executing test 2 or test 3 (see initial post)?
Making SFS2X bind IPv6 works in test 2 only.
But if you are in a test scenario where you are trying to connect to an existing external server (test 3), it won't work.
In fact in test 3 above, SFS2X must be bound to IPv4 and the iMac in the middle makes the address translation.
In other words your client connects via IPv6 to the iMac, and the iMac forwards the connection to the IPv4 server.
Paolo Bax
The SmartFoxServer Team
Tatanan
Posts: 112
Joined: 07 Jan 2014, 12:12
Contact:

Re: IPv6 support

Postby Tatanan » 01 Sep 2016, 13:14

Fixed. It was our fault.

We were using a previous version of the client Unity´s library.
Thanks for all.
weberekt
Posts: 35
Joined: 16 Sep 2014, 00:47

Re: IPv6 support

Postby weberekt » 18 Oct 2016, 07:53

SocketException: No such host is known

I have updated both client library top 1.6.6 and server to 2.11.
I put "::" into server.xml and use Public DNS field of EC2 instance as hostname.

Please help
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 18 Oct 2016, 11:56

weberekt wrote:SocketException: No such host is known

I have updated both client library top 1.6.6 and server to 2.11.
I put "::" into server.xml and use Public DNS field of EC2 instance as hostname.

Please help

Can you please describe the setup of your test? I don't think you are following our guideline, because SFS is still bound to an IPv4 address.
If you are trying to connect to an IPv6 server directly, there's no guarantee that it works; for example: are you sure your ISP provides IPv6 support? What if you try to ping6 your EC2 instance?
Paolo Bax
The SmartFoxServer Team
weberekt
Posts: 35
Joined: 16 Sep 2014, 00:47

Re: IPv6 support

Postby weberekt » 19 Oct 2016, 01:09

Bax wrote:
weberekt wrote:SocketException: No such host is known

I have updated both client library top 1.6.6 and server to 2.11.
I put "::" into server.xml and use Public DNS field of EC2 instance as hostname.

Please help

Can you please describe the setup of your test? I don't think you are following our guideline, because SFS is still bound to an IPv4 address.
If you are trying to connect to an IPv6 server directly, there's no guarantee that it works; for example: are you sure your ISP provides IPv6 support? What if you try to ping6 your EC2 instance?


My setup is TEST3. It's the test we failed for apple submission.

No.. AWS EC2 doesn't support IPv6, but I thought, for test 3, the computer acts as a bridge and translate ipv6 to ipv4?
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 19 Oct 2016, 06:22

In Test 3 SFS is configured to bind the IPv4 address of the server on which it is installed (in your case EC2), so entering "::" in its server.xml is wrong. Just use 0.0.0.0.
Paolo Bax
The SmartFoxServer Team
weberekt
Posts: 35
Joined: 16 Sep 2014, 00:47

Re: IPv6 support

Postby weberekt » 19 Oct 2016, 07:19

Bax wrote:In Test 3 SFS is configured to bind the IPv4 address of the server on which it is installed (in your case EC2), so entering "::" in its server.xml is wrong. Just use 0.0.0.0.


Yup, I just changed it back, but till not working.

I wonder what value to put into smartfox.connect(host, port)? Ipv4 address from my ec2 instance or A record DNS mapped to it?

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 42 guests