public void setPeer ( SocketAddress address ) { this . remotePeer = address ; boolean connectImmediately = false ; if ( rtpChannel != null ) { if ( rtpChannel . isConnected ( ) ) try { rtpChannel . disconnect ( ) ; } catch ( IOException e ) { logger . error ( e ) ; } connectImmediately = udpManager . connectImmediately ( ( InetSocketAddress ) address ) ; if ( connectImmediately ) try { rtpChannel . connect ( address ) ; } catch ( IOException e ) { logger . info ( "Can not connect to remote address , please check that you are not using local address - 127.0.0.X to connect to remote" ) ; logger . error ( e ) ; } } if ( udpManager . getRtpTimeout ( ) > 0 && ! connectImmediately ) { if ( shouldReceive ) { lastPacketReceived = scheduler . getClock ( ) . getTime ( ) ; scheduler . submitHeatbeat ( heartBeat ) ; } else { heartBeat . cancel ( ) ; } } }
Sets the address of remote peer .