Page 1 of 1

Problems to connecting to server on LAN

Posted: 25 Apr 2012, 12:13
by Zaddo
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)

Re: Problems to connecting to server on LAN

Posted: 25 Apr 2012, 21:56
by Jake-GR
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.

Re: Problems to connecting to server on LAN

Posted: 26 Apr 2012, 10:47
by Zaddo
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

Re: Problems to connecting to server on LAN

Posted: 26 Apr 2012, 20:59
by rjgtav
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.