I have a server set up for my game with Lidgren, and it works well when I have it set up on one machine, but if I try to run the server on another machine, I am unable to connect from other machines. I checked my port when running the server, and it says it's closed, despite the lidgren server running. I set the NetPeerConfiguration localaddress to be my ipv4 address and made sure my router was forwarded at this ipv4 address at the port I was running the server on, but still no luck. Here is the relevant server code-
NetPeerConfiguration config = new NetPeerConfiguration("Platformer"); IPAddress ipv4Addresses = Array.FindAll(Dns.GetHostEntry(string.Empty).AddressList, a => a.AddressFamily == AddressFamily.InterNetwork); config.LocalAddress = ipv4Addresses; config.Port = 8888; config.EnableMessageType(NetIncomingMessageType.ConnectionApproval); NetServer server = new NetServer(config); server.Start();
The server says it's being started at the local ip with the right port, and everything is forwarded correctly on the router. What is going wrong here?