Search code examples
androidp2plive-streaming

How to create peer-to-peer connection?


After reading a bit more about how to create P2P networks function, I wanted to start my own peer-to-peer sockets creation.

I'm working on some apps for the android platform and I have problem that I'm not quite sure how to approach, and both are closely related.

  • How can I send a relatively small data file from one android device to another ( client to client ) ?
  • Is it possible to create a temporary p2p live data stream from one android device to another ?

    i want to pass video, audio and image files from phone A's to phone B.

I would much appreciate being pointed in the right direction on either issue (File transfer or real time data transfer) if possible give me any sample application on this.


Solution

  • In SIP context, P2P network provides distributed peer location and service advertisement service. Peers advertise and learn each other's locations and services on a P2P network without the need for proxy servers.

    Therefore, both of your questions are not SIP specific. You need to use one of the many techniques to locate and join P2P overlays. Once you learn about a peer location, you can proceed to sending SIP messages.

    SIP is a signalling protocol. It provide a set of mechanism to help establishing sessions. Data streams transmission, in your case, is not of SIP's concern. The details of file transfer in SIP/SDP is documented in RFC5547.

    To learn about SIP, the best place to start is the RFC3261. RFC3665 has really helpful call flow diagrams. RFC5441 lists SIP related RFCs. Also checkout P2PSIP WG's RELOAD protocol.