Anyone have UDP issues on Windows?

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

Moderators: Lapo, Bax

ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Anyone have UDP issues on Windows?

Post 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
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Post 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)
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Post 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
Last edited by ThomasLund on 20 Nov 2010, 14:42, edited 1 time in total.
vooood
Posts: 45
Joined: 08 Oct 2010, 09:04
Location: Croatia

Post 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.
tmada
Posts: 9
Joined: 30 Oct 2010, 06:01

Re: Anyone have UDP issues on Windows?

Post 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).
stevets
Posts: 60
Joined: 11 Jul 2010, 12:22
Location: USA

Post by stevets »

The FPS demo works on my windows server. Great job and thanks Thomas!
Steve
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Post 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
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Post 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
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Post by appels »

ah... will add it.
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Post by appels »

yep, now it's working and i don't get the error anymore
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Post by ThomasLund »

Purrfect
lastowl
Posts: 36
Joined: 12 Aug 2010, 20:56

Post 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)
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Post by appels »

did you enable UDP on the server ?
lastowl
Posts: 36
Joined: 12 Aug 2010, 20:56

Post by lastowl »

it was a nice caching error from left over logs and files from the preview version fixed now
ulimo
Posts: 5
Joined: 20 Nov 2010, 13:20

Post 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.
Post Reply