Page 1 of 4

Anyone have UDP issues on Windows?

Posted: 19 Nov 2010, 05:40
by ThomasLund
There are several people who have reported problems with UDP in the FPS demo that was just released.

Has anyone been having trouble with UDP in general using Unity on Windows?

/Thomas

Posted: 19 Nov 2010, 06:34
by appels
on vista 64 bit i'm getting :
[SFS DEBUG] UDPSocketLayer: Error reading data from socket: An existing connection was forcibly closed by the remote host.
[SFS DEBUG] Unexpected UDP I/O Error. Error reading data from socket: An existing connection was forcibly closed by the remote host.
[ConnectionReset]
[SFS DEBUG] UDPSocketLayer: Exception aborting socket thread: Thread was being aborted
UDP error:
UnityEngine.Debug:Log(Object)
LobbyGUI:OnUdpInit(BaseEvent) (at Assets/Lobby/Scripts/LobbyGUI.cs:141)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
LobbyGUI:FixedUpdate() (at Assets/Lobby/Scripts/LobbyGUI.cs:83)

Posted: 19 Nov 2010, 06:39
by ThomasLund
From the location of the exception it seems that UDP isnt even initializing.

I take it that both the server and client are running on the windows box?

Running SFS2X rc1a?

Could you please try to connect your game client to this ip: XXXX (shut down again) (my laptop on a mac running rc1a - so just running right now)

See if we can isolate things to server, api or game code.

Thanks

/Thomas

Posted: 19 Nov 2010, 07:09
by vooood
I solved this UDP issue for me. Even with the Windows Firewall disabled adding an exception on port 9933 (I added both TCP and UDP but UDP only migh be enough) solved the problem for me and I was able to connect and play. Win XP Pro, but I believe it's the same for all.

Re: Anyone have UDP issues on Windows?

Posted: 19 Nov 2010, 08:29
by tmada
I already had the ports open for SFS2X previously so I didn't have any problems there (Windows 7 native Firewall). The only additional step required here was to enable UDP in the SFS2X Admin panel (this step is also in the tutorial pdf).

Posted: 19 Nov 2010, 08:42
by stevets
The FPS demo works on my windows server. Great job and thanks Thomas!
Steve

Posted: 19 Nov 2010, 08:57
by appels
Thomas,

i got a policy error when connecting to yours :


[SFS DEBUG] TCPSocketLayer: General exception on connection: Unable to connect, as no valid crossdomain policy was found at System.Net.Sockets.Socket.Connect_internal (IntPtr sock, System.Net.SocketAddress sa, System.Int32& error, Boolean requireSocketPolicyFile) [0x00000] in <filename unknown>:0
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

Posted: 19 Nov 2010, 09:05
by ThomasLund
Ahhh - did you add the policy prefetch command to the code?

Another todo I guess for the code - can comment it out with a fat comment

/Thomas

Posted: 19 Nov 2010, 09:07
by appels
ah... will add it.

Posted: 19 Nov 2010, 09:14
by appels
yep, now it's working and i don't get the error anymore

Posted: 19 Nov 2010, 09:24
by ThomasLund
Purrfect

Posted: 19 Nov 2010, 11:23
by lastowl
the error ive got is, ive only just looked at the demo though, im using 10.6.5 and sf2 rca1 and using unity 2.6


Logged in successfully
UnityEngine.Debug:Log(Object)
LobbyGUI:OnLogin(BaseEvent) (at Assets/Lobby/Scripts/LobbyGUI.cs:123)
System.MulticastDelegate:invoke_void_BaseEvent(BaseEvent)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
LobbyGUI:FixedUpdate() (at Assets/Lobby/Scripts/LobbyGUI.cs:83)

(Filename: Assets/Lobby/Scripts/LobbyGUI.cs Line: 123)

[SFS - ERROR] UDPSocketLayer: Error reading data from socket: Connection refused
[SFS DEBUG] UDPSocketLayer: Error reading data from socket: Connection refused

(Filename: /Users/build/builds/unity-26/unity-2.6.x/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 1783)

[SFS - WARN] Unexpected UDP I/O Error. Error reading data from socket: Connection refused [ConnectionRefused]
[SFS DEBUG] Unexpected UDP I/O Error. Error reading data from socket: Connection refused [ConnectionRefused]

(Filename: /Users/build/builds/unity-26/unity-2.6.x/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 1783)

[SFS - WARN] UDPSocketLayer: Exception aborting socket thread: Thread was being aborted
[SFS DEBUG] UDPSocketLayer: Exception aborting socket thread: Thread was being aborted

(Filename: /Users/build/builds/unity-26/unity-2.6.x/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 1783)

recursion depth: 1
[SFS - ERROR] UDPSocketLayer: Error writing to socket: Connection refused
[SFS DEBUG] UDPSocketLayer: Error writing to socket: Connection refused

(Filename: /Users/build/builds/unity-26/unity-2.6.x/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 1783)

[SFS - WARN] Unexpected UDP I/O Error. Error writing to socket: Connection refused [ConnectionRefused]
[SFS DEBUG] Unexpected UDP I/O Error. Error writing to socket: Connection refused [ConnectionRefused]

(Filename: /Users/build/builds/unity-26/unity-2.6.x/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 1783)

UDP error:
UnityEngine.Debug:Log(Object)
LobbyGUI:OnUdpInit(BaseEvent) (at Assets/Lobby/Scripts/LobbyGUI.cs:141)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
LobbyGUI:FixedUpdate() (at Assets/Lobby/Scripts/LobbyGUI.cs:83)

(Filename: Assets/Lobby/Scripts/LobbyGUI.cs Line: 141)

Posted: 19 Nov 2010, 11:27
by appels
did you enable UDP on the server ?

Posted: 20 Nov 2010, 09:44
by lastowl
it was a nice caching error from left over logs and files from the preview version fixed now

Posted: 20 Nov 2010, 13:23
by ulimo
Hey, I have a bit of problem with UDP on windows 7 x64.
Before the demo release I wrote my own multiplayer code but had problems that the game would allways freeze when I tryied to quit it with UDP enabled.
Problem were gone if I used TCP.
I thought it was just something wrong in my code but the same problem exists in the FPS demo.
So atleast I am getting freezes when trying to exit the game with UDP in use.