Connect Closed by Remote Site

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

Moderators: Lapo, Bax

djindepth
Posts: 10
Joined: 06 Nov 2014, 03:02

Connect Closed by Remote Site

Postby djindepth » 30 Apr 2019, 00:54

Unity Advanced Connector Error

Now connecting...
Connection established successfully
SFS2X API version: 1.7.9
Connection mode is: Socket
[SFS > ERROR] [TCPSocketLayer] Connection closed by the remote side
Connection was lost; reason is: unknown

Running server 2.13.1
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Connect Closed by Remote Site

Postby Lapo » 30 Apr 2019, 06:50

Hi,
we need a bit more context about this.
For example you're not saying how long does it take for the error to show up. Is it immediately after having connected?
Did you check the server side logs for more details?

Is this happening over the internet or in a local environment?
Is it reproducible or just happened once/few times?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
djindepth
Posts: 10
Joined: 06 Nov 2014, 03:02

Re: Connect Closed by Remote Site

Postby djindepth » 30 Apr 2019, 17:48

Thank you for the prompt.

We are not using webGL.
We are connecting to a school run server using an IP address/Domain: smartfox.neit.edu port 9933.
The debug shows that we connect, and the admin dashboard shows a user, but it can't seem to engage the zone.
It times out after 20 seconds. I have tried changing the timeout limit.
I have tried Connector and Advanced Connector. As a guest and not as a guest.

I don't see anything on the server logs. I might not be looking in the correct place.

We recently moved the server and have implemented a lot of security measures due to infiltration problems. It worked fine on the previous server, but has failed on the new server. Localhost works fine.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Connect Closed by Remote Site

Postby Lapo » 01 May 2019, 10:28

The 20 second timeout indicates that the client is connected but it's not trying to log in. Or can't log in.

Since you said you're using our Examples, you should be able to check the debug log in the Unity Editor and see if there are any errors.
Does the client actually log in? Do you get the relative event?
If not, what happens instead?

Maybe you can post here the transcript of the debug session.

Thanks
p.s. = you can activate the Debug log by setting the relative flag in the ConfigData object, in the source example.
Lapo

--

gotoAndPlay()

...addicted to flash games
djindepth
Posts: 10
Joined: 06 Nov 2014, 03:02

Re: Connect Closed by Remote Site

Postby djindepth » 01 May 2019, 12:01

ConfigData


Debug
Now connecting...
[SFS > INFO] Data written: Binary Size: 52
12 00 03 00 01 63 02 00 00 01 61 03 00 00 00 01 .....c....a.....
70 12 00 02 00 03 61 70 69 08 00 05 31 2e 37 2e p.....api...1.7.
39 00 02 63 6c 08 00 0c 55 6e 69 74 79 20 2f 20 9..cl...Unity./.
2e 4e 65 74 .Net

[SFS > INFO] Data Read: Binary Size: 80
80 00 4d 12 00 03 00 01 70 12 00 03 00 02 63 74 ..M.....p.....ct
04 00 00 04 00 00 02 6d 73 04 00 07 a1 20 00 02 .......ms.......
74 6b 08 00 20 34 31 34 30 64 61 37 65 36 33 64 tk...4140da7e63d
36 34 30 33 35 35 32 66 62 39 30 61 35 66 65 35 6403552fb90a5fe5
65 33 38 34 38 00 01 61 03 00 00 00 01 63 02 00 e3848..a.....c..

[SFS > INFO] Message: Handshake { Message id: 0 }
{ Dump: }

(int) ct: 1024
(int) ms: 500000
(utf_string) tk: 4140da7e63d6403552fb90a5fe5e3848

Connection established successfully
SFS2X API version: 1.7.9
Connection mode is: Socket
Lag monitor can be started after a successful login only
[SFS > ERROR] [TCPSocketLayer] Connection closed by the remote side
Connection was lost; reason is: unknown
djindepth
Posts: 10
Joined: 06 Nov 2014, 03:02

Re: Connect Closed by Remote Site

Postby djindepth » 01 May 2019, 17:26

13:22:36,255 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | Session created: { Id: 8, Type: DEFAULT, Logged: No, IP: 10.30.0.184:21367 } on Server port: 9933 <---> 21367

01 May 2019 |

13:23:14,045 | INFO | Scheduler1-thread-1 | bitswarm.sessions.DefaultSessionManager | Session removed: { Id: 8, Type: DEFAULT, Logged: No, IP: 10.30.0.184:21367 }
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Connect Closed by Remote Site

Postby Lapo » 02 May 2019, 07:13

Hi,
from the logs I can't see anything out of order.

What is happening is that your application is connecting but then it doesn't send a LoginRequest, and the server kicks the client after the configured "Idle Session Timeout" parameter. Which is usually ~20 seconds.

You should double check your code and see why the login req. is missing. Typically you want to send the request when you get the SFSEvent.CONNECTION with the "success" param. set to "true".

For further info you may want to take a look at this tutorial:
http://docs2x.smartfoxserver.com/ExamplesUnity/lobby

Hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games
djindepth
Posts: 10
Joined: 06 Nov 2014, 03:02

Re: Connect Closed by Remote Site

Postby djindepth » 02 May 2019, 11:39

We ran the same code on two other networked servers. They operated normally. Our guess is there is a firewall issue on the new server. Any thoughts about how to troubleshoot something like that? Does it make sense that the client can connect, but now log in? Any point in checking or unchecking encryption flags?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Connect Closed by Remote Site

Postby Lapo » 02 May 2019, 15:06

Hi,
I would not include encryption in the test, for the time being.
It's one less variable to take into account. So I would turn off encryption in the current Zone you're using and test again.

As regards firewall issue, it's not possible, since you're already connecting and sending data to and from the server, as evidenced by the client transcript you've posted.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 38 guests