-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SocketException error when running project in Unity #3
Comments
So I'm checking into this but I'm having trouble repoing. I installed Windows 10 x64 but no luck. I'll try a Wifi connection next (gotta get a USB Wifi thingy) Can you think of anything different on your Laptop vs Desktop? Is one Windows 10 x32 and the other x64? Has one got anti-virus software or something? Maybe you could run the built in "System Information" on each, pick File->Export and attach the results here? |
So I went and got a USB WiFi Adaptor but no error 😓 We could try a new version of WebSocketSharp |
Download this, unzip, and put the |
Just tried explicitly turning off the Firewall completely on the laptop, but that didn't help. I guess the "unity.exe" / "Unity Editor" entry in the firewall settings is a red herring. I've tried comparing the network settings reported by ipconfig for the two machines, and they seem to match for that connection (i.e. the Local Area Connection for the desktop and the Wireless LAN for the laptop match in terms of DHCP/DNS/Gateway etc.). |
It's possible. It should be connecting to 0.0.0.0 which is all adapators. I wonder if it's one of the tunnel or VMWare adaptors I don't think this will help but you could go to Window->HappyFunTimes->Settings and in the Debug area put a Run it, quit unity, and drag and drop the https://docs.unity3d.com/Manual/LogFiles.html I think it's the Sadly the time difference. It's 4:30am in Tokyo so I need to go to sleep. I'll take a look in the morning |
There's a StartServer, then a load of HFTWebFileDB messages that all seem fine. The point around which the error is logged is here:
When comparing to the log output on the other machine that is working, there is an entry there for |
Ah - I see that the HFTSite message is related to the "Installation Mode" option which I had been tinkering with (which was enabled on the laptop and not the desktop). When I turn that off I do see the same log on both the working and not-working machine. I even get a confirmation back on the not-working machine that:
|
I've just tried disabling the Wi-Fi adapter and using the Wired Ethernet connection on the laptop machine instead, but still get the same SocketException error. |
A few more things Can you post your Also Can you try commenting out List<string> addresses = new List<string>();
// addresses.Add("http://[::0]:" + m_options.serverPort); // <=--- THIS LINE
#if UNITY_STANDALONE_WIN
addresses.Add("http://0.0.0.0:" + m_options.serverPort);
#endif |
YES! Commenting out that line fixed it. I don't understand why, but you've got it working. Thankyou! |
Well I hope you can help me figure out why. For example I tried disabling IPv6 in Windows and it still works. I tried disabling IPv6 at an even lower level and it still worked. I tried installing virtualbox (don't have VMware for Windows) but it still worked. I can't leave that line out as then it will stop working other places. So, the question is why is it failing and how can I detect when I need that line and when I don't :( I'm still hoping you could post the NOTE: As far as I know there's no risk in posting that info. All of that info is broadcast to every website you ever visit so it's not like it's secret info |
I just tried my laptop on a completely different Wi-Fi connection (at a coffee shop), and still get the same behaviour - with line 247 commented out it works great, but with it left in I get the SocketException. Here's the results of ipconfig /all: (incidentally, I have no idea why this computer is called "DESKTOP-TQLT36I" - it's not a desktop, it's a laptop, but that's how it came supplied!) Windows IP Configuration Host Name . . . . . . . . . . . . : DESKTOP-TQLT36I Ethernet adapter Ethernet: Media State . . . . . . . . . . . : Media disconnected Wireless LAN adapter Local Area Connection* 2: Media State . . . . . . . . . . . : Media disconnected Wireless LAN adapter Wi-Fi 2: Connection-specific DNS Suffix . : Tunnel adapter Local Area Connection* 3: Media State . . . . . . . . . . . : Media disconnected Tunnel adapter isatap.{F7FF1621-500E-431D-BFD9-E6B276D22AE0}: Media State . . . . . . . . . . . : Media disconnected |
Thank you for that! I don't see anything obvious. Even stranger it shows you have an IPv6 address so it seems like it should work. Sigh.... I might just have to resort to putting a try/catch in the server to just ignore the error. I just don't want it to get lost if it's pointing out a real issue |
I'll confess to not knowing much about IPv6 (although that definitely seems related to the issue). But looking around the code in line 36 of HFTIpUtils, I see that GetLocalIPAddress strips out the interface identifier after the % sign. Is that correct? According to the answer given by TOOGAM at But, like I said, I'm no expert - I'm just trying to toss out ideas to help you help me! :) |
As crude test, I just tried hardcoding the interface identifier onto the end of the address on line 247 as Sadly, no dice (would have been a miracle if it had worked - this is way out of my sphere of knowledge!) |
Hi, I know this is an old post, but might help someone else facing same issue. I was also facing same issue, i tried uninstalling antivirus program on machine and it worked. Have you tried uninstalling your Anti-virus program on your laptop? Some Anti-virus programs block websocket Thanks, |
Not OP but I resolved this issue on my machine as I was using an old ipv4 ip address instead of ipv6. Changing 127.0.0.1 to ::1 fixed it for me. |
Hi! I have two machines on my home network - a desktop and a laptop, both running Windows 10 64bit. When I run the HFT Unity project on the desktop (which has a wired connection to the router), everything runs great - I can connect to the server and join the game from my mobile and the laptop (either by going to happyfuntimes.net or by directly specifying the IP address of the desktop which, to be honest, I prefer)
But when I try to run the project on the laptop (which has a Wi-Fi connection to the router), I get the following error in the console:
The game runs, but no clients can connect. From preliminary Googling (e.g. http://stackoverflow.com/questions/24870277/an-address-incompatible-with-the-requested-protocol-was-used) it seems like this might be related to IP4/IP6 addressing -but I've had a quick poke through the HFT code and it looks like it should adapt correctly for either. I've tried disabling IP4/IP6 individually on the network adapter but no difference :)
The text was updated successfully, but these errors were encountered: