Is a separate rtc :: Runnable stream and PeerConnectionFactory required for each peer in a webrtc native application?

I am trying to create my own application using my own WebRTC APIs . For the first peer, I create an rtc :: Runnable object and in its Run method I create a PeerConnectionFactory object. Then from this object I create a peerconnection object and create a sentence and continue to install local and remote descriptions and ICE configuration, etc., and everything is going well.

Now I'm trying to figure out what I should do for a second partner from the same process. Do I need to create another rtc :: Runnable thread or can I reuse it and its peer factory to create a separate peerconnection object?

It might be somewhere in the documentation, but I could not find it. It is clear that I need a separate peer connection for each peer and separate observer objects for each of these connections.

It is rather a design issue, which, of course, uses all the individual works.

+4
source share
1 answer

The factory peer should be used by all peers, you do not need to have 2 factories. This way you can create a connection as many as you need with the same factory. When you create a peer, you can also create a new observer, but you can have an observer that processes events the same way for each peer.

Eg. , B , B , .

0

Source: https://habr.com/ru/post/1691584/


All Articles