Problems to connecting to server on LAN

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

Moderators: Lapo, Bax

Zaddo
Posts: 4
Joined: 25 Apr 2012, 11:26

Problems to connecting to server on LAN

Postby Zaddo » 25 Apr 2012, 12:13

I am having a problem logging into my unity game to the server on another PC, either a Virtual PC on me development PC or another PC on my home wireless network. I can connect, but I cannot login. This is using a slightly modified version of the FPS sample.

These are the debug messages I get in the unity console. Any help offered will be very much appreciated.

Thx.
Tony

Login ok
UnityEngine.Debug:Log(Object)
ConnectionGUI:OnLogin(BaseEvent) (at Assets/Lobby/Scripts/ConnectionGUI.cs:248)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
ConnectionGUI:FixedUpdate() (at Assets/Lobby/Scripts/ConnectionGUI.cs:66)

[SFS DEBUG] UDPSocketLayer: Error reading data from socket: An existing connection was forcibly closed by the remote host.

UnityEngine.Debug:Log(Object)
ConnectionGUI:OnDebugMessage(BaseEvent) (at Assets/Lobby/Scripts/ConnectionGUI.cs:237)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
ConnectionGUI:FixedUpdate() (at Assets/Lobby/Scripts/ConnectionGUI.cs:66)

[SFS DEBUG] Unexpected UDP I/O Error. Error reading data from socket: An existing connection was forcibly closed by the remote host.
[ConnectionReset]
UnityEngine.Debug:Log(Object)
ConnectionGUI:OnDebugMessage(BaseEvent) (at Assets/Lobby/Scripts/ConnectionGUI.cs:237)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
ConnectionGUI:FixedUpdate() (at Assets/Lobby/Scripts/ConnectionGUI.cs:66)

[SFS DEBUG] [ BB-Send ]: 9c2e8598be3257a8babf1186f5514606|poll|null
UnityEngine.Debug:Log(Object)
ConnectionGUI:OnDebugMessage(BaseEvent) (at Assets/Lobby/Scripts/ConnectionGUI.cs:237)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
ConnectionGUI:FixedUpdate() (at Assets/Lobby/Scripts/ConnectionGUI.cs:66)
Jake-GR
Posts: 59
Joined: 28 Dec 2011, 22:52

Re: Problems to connecting to server on LAN

Postby Jake-GR » 25 Apr 2012, 21:56

Haven't seen any of these errors myself, but it's showing a UDP error, so might be a good idea to double-check the listening ip:port (tcp and udp) on the server.

Note: if build setting is set to Web Player in Unity, you either need to turn on the Flash security option on the server, or pre-fetch the policy (from Unity) for both TCP and UDP.
Zaddo
Posts: 4
Joined: 25 Apr 2012, 11:26

Re: Problems to connecting to server on LAN

Postby Zaddo » 26 Apr 2012, 10:47

I found my problem.

You need to add the LAN IP address of the server and listening port using the admin tool.

Out of the box, it has 127.0.0.1 configured. But this only allows you to connect on the same PC the server is running on.

I would appreciate if you can confirm this is correct.

Thx
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Problems to connecting to server on LAN

Postby rjgtav » 26 Apr 2012, 20:59

Hi.
Yes, that's correct. You need to also add the server's internal ip to the bound ip list in order to connect from different computers.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 32 guests