2 sinat 34425079 sinat_34425079 于 2016.04.18 20:43 提问

Java RTP如何解决数据包只有1480字节大小的限制

发送端代码:
public static void openSession() {
InitSession test = new InitSession();
byte[] data = new byte[1500];
System.out.println("Send Length:"+data.length);

    long timeStarted = System.currentTimeMillis();
    int i = 0;
    while(i<3){
        test.rtpSession.sendData(data);
        i++;
    }

    long timeStop = System.currentTimeMillis();
    System.out.println("发送用时:"+(timeStop-timeStarted));
}

错误:
RtpPkt.setPayload: Cannot carry more than 1480 bytes for now.

RtpPkt() failed, check with checkPkt()
Exception in thread "main" java.lang.NullPointerException
at jlibrtp.RtpPkt.getPayloadLength(RtpPkt.java:150)
at jlibrtp.RtpPkt.writePkt(RtpPkt.java:296)
at jlibrtp.RtpPkt.encode(RtpPkt.java:201)
at jlibrtp.RTPSession.sendData(RTPSession.java:321)
at jlibrtp.RTPSession.sendData(RTPSession.java:244)
at RTPServer.openSession(RTPServer.java:17)
at RTPServer.main(RTPServer.java:5)

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!