Lidgren Network

Started by
3 comments, last by EJH 14 years, 8 months ago
I am using the Lidgren UDP networking Library in C#. Everything is fine when client and server are on the same box. However once I am trying to connect from a separate machine I don't seem to have any activity per wireshark on the designated port. Is there something beyond client.Start(); and client.connect(hostname,port) I need to be aware of?
Advertisement
First, make sure that the address of the other machine is configured properly on the client.

Second, make sure that the other host really is reachable -- that there is no NAT or firewall in the way.
enum Bool { True, False, FileNotFound };
Ok the server is on a split tunnel VPN. The client is on the local side of the network.

The firewall between them is not on. I can ping the server from the client. But I am not getting a response via lidgren.

If I do have to get into natting is there a good resource to understand how to set it up or can lidgren library handle it? Should i be considering a different library?
Make sure you're using the correct network interface; there's a Start() override where you can specify which address to bind to.
Not sure if you are doing this or not:

- on LAN or LOCALHOST you should use NetClient.DiscoverLocalServers(ip);
- everything else NetClient.DiscoverKnownServer(ip, port);

Do either of those, then

- you will recieve a NetMessageType.ServerDiscovered back from the server
- call NetClient.Connect() with the NetBuffer.ReadIPEndPoint() read from the ServerDiscovered message

Also Lidgren himself posts often and is very helpful on the Google Group. Definitely worth registering for:

http://groups.google.com/group/lidgren-network

This topic is closed to new replies.

Advertisement