Skip to content
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

Unity 2019.4 LTS: calling client.Connect gives SocketException Invalid arguments immediately #142

Open
miwarnec opened this issue Jul 13, 2020 · 3 comments

Comments

@miwarnec
Copy link

Hey guys,
when using Lidgren master in Unity 2019.4 LTS I get the following error when calling client.Connect:

"Failed to send packet: System.Net.Sockets.SocketException (0x80004005): Invalid arguments
at System.Net.Sockets.Socket.SendTo (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP) [0x00082] in :0
at Lidgren.Network.NetPeer.ActuallySendPacket (System.Byte[] data, System.Int32 numBytes, System.Net.IPEndPoint target, System.Boolean& connectionReset) [0x000bc] in /Users/qwerty/x/dev/project_DOTSNET/RepositoryDOTS/Assets/DOTSNET/Scripts/ECS/Transport/Transports/Lidgren/Lidgren_2020-07-13/NetPeer.LatencySimulation.cs:164 "

It happens both when a server is running, and when a server isn't running.

I dropped Lidgren in as source code, not as DLL.

Anyone knows what might be causing this?
I can't be the only one using Lidgren in Unity?

Thanks :)

@miwarnec
Copy link
Author

Here is the line that causes it:
2020-07-13_18-30-14

Here is the data that is being passed:
2020-07-13_18-30-02

@miwarnec
Copy link
Author

Note that the error is in LatencySimulation.cs - I didn't turn on latency simulation though. Unless that's enabled by default, but why would it?

@miwarnec
Copy link
Author

Checking LatencySimulation.cs: looks like #if DEBUG is enabled in Unity editor.
I removed that #if DEBUG part so it uses regular send.
Still get the same error though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant