src/net/java/sip/communicator/impl/protocol/jabber/RawUdpTransportManager.java
/**
     * Creates a raw UDP transport element according to a specific
     * <tt>StreamConnector</tt>.
     *
     * @param mediaType the <tt>MediaType</tt> of the <tt>MediaStream</tt> which
     * uses the specified <tt>connector</tt> or <tt>channel</tt>
     * @param connector the <tt>StreamConnector</tt> to be described within the
     * transport element
     * @return a {@link RawUdpTransportPacketExtension} containing the RTP and
     * RTCP candidates of the specified <tt>connector</tt>
     */
Creates a raw UDP transport element according to a specific
StreamConnector.

@param mediaType the MediaType of the MediaStream which
uses the specified connector or channel
@param connector the StreamConnector to be described within the
transport element
@return a  RawUdpTransportPacketExtension containing the RTP and
RTCP candidates of the specified connector
Creates a raw UDP transport element according to a specific StreamConnector . @param mediaType the MediaType of the MediaStream which uses the specified connector or channel @param connector the StreamConnector to be described within the transport element @return a RawUdpTransportPacketExtension containing the RTP and RTCP candidates of the specified connector
private RawUdpTransportPacketExtension createTransport(
            MediaType mediaType,
            StreamConnector connector)
    {
        RawUdpTransportPacketExtension ourTransport
            = new RawUdpTransportPacketExtension();
        int generation = getCurrentGeneration();
        CandidatePacketExtension rtpCand = new CandidatePacketExtension();
        rtpCand.setComponent(CandidatePacketExtension.RTP_COMPONENT_ID);
        rtpCand.setGeneration(generation);
        rtpCand.setID(getNextID());
        rtpCand.setType(CandidateType.host);
        DatagramSocket dataSocket = connector.getDataSocket();
        rtpCand.setIP(dataSocket.getLocalAddress().getHostAddress());
        rtpCand.setPort(dataSocket.getLocalPort());
        ourTransport.addCandidate(rtpCand);
        CandidatePacketExtension rtcpCand = new CandidatePacketExtension();
        rtcpCand.setComponent(CandidatePacketExtension.RTCP_COMPONENT_ID);
        rtcpCand.setGeneration(generation);
        rtcpCand.setID(getNextID());
        rtcpCand.setType(CandidateType.host);
        DatagramSocket controlSocket = connector.getControlSocket();
        rtcpCand.setIP(controlSocket.getLocalAddress().getHostAddress());
        rtcpCand.setPort(controlSocket.getLocalPort());
        ourTransport.addCandidate(rtcpCand);
        return ourTransport;
    }
private RawUdpTransportPacketExtension createTransport ( MediaType mediaType , StreamConnector connector ) { RawUdpTransportPacketExtension ourTransport = new RawUdpTransportPacketExtension ( ) ; int generation = getCurrentGeneration ( ) ; CandidatePacketExtension rtpCand = new CandidatePacketExtension ( ) ; rtpCand . setComponent ( CandidatePacketExtension . RTP_COMPONENT_ID ) ; rtpCand . setGeneration ( generation ) ; rtpCand . setID ( getNextID ( ) ) ; rtpCand . setType ( CandidateType . host ) ; DatagramSocket dataSocket = connector . getDataSocket ( ) ; rtpCand . setIP ( dataSocket . getLocalAddress ( ) . getHostAddress ( ) ) ; rtpCand . setPort ( dataSocket . getLocalPort ( ) ) ; ourTransport . addCandidate ( rtpCand ) ; CandidatePacketExtension rtcpCand = new CandidatePacketExtension ( ) ; rtcpCand . setComponent ( CandidatePacketExtension . RTCP_COMPONENT_ID ) ; rtcpCand . setGeneration ( generation ) ; rtcpCand . setID ( getNextID ( ) ) ; rtcpCand . setType ( CandidateType . host ) ; DatagramSocket controlSocket = connector . getControlSocket ( ) ; rtcpCand . setIP ( controlSocket . getLocalAddress ( ) . getHostAddress ( ) ) ; rtcpCand . setPort ( controlSocket . getLocalPort ( ) ) ; ourTransport . addCandidate ( rtcpCand ) ; return ourTransport ; }
Creates a raw UDP transport element according to a specific
 <tt>StreamConnector</tt>.
Creates a raw UDP transport element according to a specific <tt > StreamConnector< / tt > .
// create and add candidates that correspond to the stream connector // RTP // RTCP