The Peer-to-Peer Networking Package The peer-to-peer package of the SFC allows you to create robust and lightweight peer-to-peer applications.

Package Specification

The peer-to-peer package of the SFC allows you to create robust and lightweight peer-to-peer applications.

The central point of the whole thing is the PeerToPeer-class. It represents one single peer-to-peer node running on a computer. This node is client and server at the same time. It has the following features:

  1. Create a sparsely connected network of a random amount of computers.
  2. Any peer might open a connection to any other peer it knows at any time.
  3. If connection is currently not possible, maybe due to traffic/computational overload, the peer is internally marked as faulty and enqueued into a list. In longer getting cycles, it is tried to connect to the peer again. After a long time without responses, the peer is removed from the list. Therefore, any new peer contacting your node will be used instead.
  4. Connections are accepted and buffered. If two many pending connections are buffered, older ones will be closed automatically, leading to our node being marked as faulte on the connecting node.