P2P module is responsible for integrating with P2P network suitable with the environment where application is running and provides P2P data channel, video channel and voice channel.
P2P is used by CG for features that require real-time collaboration between peers. P2P allows data to be transmitted between peers so that content can dynamically change for all the participants in the P2P session.
Voice and Video Channels
Voice and Video channels are used by CG for the purpose of creating Chat widgets, and also screen capture. Chat widgets are widget that uses P2P channels for the purpose of chat. This may be short messages chat, voice chat, video chat or the combination of those.
CG system is providing with default Chat widget but other chat widgets can be created using the API.
Data channel is a p2p module that can be plugged with a Widget in order to provide real-time collaboration. Many of Widgets provided by CG uses this module. This module interacts with various changes in the state and content of a Widget and distributes those changes between collaborating peers, in the form of messages. For example TextBox widget uses data channel to send to parties the text content so that parties are able to edit the text together. Another example, P2P data channel is used by some Widgets to distribute changes in the position and size of a Widget so that position and size is coordinated automatically between peers.
P2P And Content Glass Environments
P2P technology may be implemented differently on different platforms and environments. For example WebRTC on the new web browsers, JXTA on Java platform, SIP, wifi.p2p for Android, Open Peer for iOS and other. CG uses and existing P2P technologies for implementing the required P2P functionality. Not all CG Client libraries may share the same technology.