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

Failed to send packet: System.Net.Sockets.SocketException #130

Open
tolstenko opened this issue Sep 2, 2019 · 2 comments · May be fixed by #143
Open

Failed to send packet: System.Net.Sockets.SocketException #130

tolstenko opened this issue Sep 2, 2019 · 2 comments · May be fixed by #143

Comments

@tolstenko
Copy link

I am facing this issue:

Socket bound to 0.0.0.0:63658: True
Network thread started
InitiatedConnect: user called connect
Failed to send packet: System.Net.Sockets.SocketException (0x80004005): An address incompatible with the requested protocol was used
   at System.Net.Sockets.Socket.SendTo(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, EndPoint remoteEP)
   at Lidgren.Network.NetPeer.ActuallySendPacket(Byte[] data, Int32 numBytes, IPEndPoint target, Boolean& connectionReset) in D:\projects\lidgren-network-gen3\Lidgren.Network\NetPeer.LatencySimulation.cs:line 164

Dns.GetHostEntry also returns IPv6 addresses. In this case, the IPv6 address (::1) is first in the list.

Steps to reproduce:

  1. download latest codebase
  2. open any example. in my case, I tested the chat client / server
  3. run and fail

Probably this could be caused by having many vEthernets on my machine and wifi.

@kaholau
Copy link

kaholau commented Jul 13, 2020

I also have the same issue.
You can either change the targeting master server ip address to 127.0.0.1 in both MSServer and MSClient or change the default local address of Master Server to m_localAddress = IPAddress.IPv6Any or change the localhost solver in you OS to 127.0.0.1.

@PJB3005
Copy link
Contributor

PJB3005 commented Jul 16, 2020

Should probably make NetPeer.Connect(string host,...) overloads select IP based on currently configured address family.

PJB3005 added a commit to space-wizards/SpaceWizards.Lidgren.Network that referenced this issue Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants