pnwebrtc/src/main/java/me/kevingleason/pnwebrtc/PnPeerConnectionClient.java
public void closeConnection(String id){
        JSONObject packet = new JSONObject();
        try {
            if (!this.peers.containsKey(id)) return;
            PnPeer peer = this.peers.get(id);
            peer.hangup();
            packet.put(PnRTCMessage.JSON_HANGUP, true);
            transmitMessage(id, packet);
            mRtcListener.onPeerConnectionClosed(peer);
        } catch (JSONException e){
            e.printStackTrace();
        }
    }
public void closeConnection(String id){
        JSONObject packet = new JSONObject();
        try {
            if (!this.peers.containsKey(id)) return;
            PnPeer peer = this.peers.get(id);
            peer.hangup();
            packet.put(PnRTCMessage.JSON_HANGUP, true);
            transmitMessage(id, packet);
            mRtcListener.onPeerConnectionClosed(peer);
        } catch (JSONException e){
            e.printStackTrace();
        }
    }
public void closeConnection ( String id ) { JSONObject packet = new JSONObject ( ) ; try { if ( ! this . peers . containsKey ( id ) ) return ; PnPeer peer = this . peers . get ( id ) ; peer . hangup ( ) ; packet . put ( PnRTCMessage . JSON_HANGUP , true ) ; transmitMessage ( id , packet ) ; mRtcListener . onPeerConnectionClosed ( peer ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } }
Close connection (hangup) no a certain peer.
@param id PnPeer id to close connection with
Close connection ( hangup ) no a certain peer .