I am currently integrating Lidgren into my Unity game. I need to move away from the built in networking capability in Unity because of the style of game I am making, basically MMO, I will have far too much information routing through the server just to get from one peer to another.

With Lidgren I am hoping that the peers that need to send information to each other can connect and send messages while maintaining the server connection.

My question is that if I have say 2 people already connected to each other with NetPeer and a third connects to one of them, will all three automatically be connected to each other as peers, or do i have to connect the third to both other players manually?


1 Answer 1


A NetPeer in Lidgren is like a "node" in the network (like a vertex). You only need one per machine (or per instance of your application).

A NetConnection is what you use to connect NetPeers together over the network (like an edge).

Each NetPeer can have multiple NetConnections.

You must form all of the connections between peers yourself. One peer must make make the connection and another must accept it. Creating a connection between one pair of peers does not create any other connections.

Lidgren has no built-in functionality for managing P2P networks (even though it can make P2P connections). You must write this functionality yourself.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .