Framework for creating peer-to-peer applications