Hi , All
I am working on an VOIP application witch require to play the RTP (audio) packet that are comming from the RTP server throught UDP connection ,
how to send RTP packet inorder to compute packet loss ?Whether can provide an example reference
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi , All
I am working on an VOIP application witch require to play the RTP (audio) packet that are comming from the RTP server throught UDP connection ,
how to send RTP packet inorder to compute packet loss ?Whether can provide an example reference
Last edited by NARs; October 23rd, 2009 at 03:12 AM.
Why not use TCP instead then?
Have a look at Apache MINA - Index for some nice tools for networking
// Json
Because I don't mind to loss the packet.
so do you know how to send packet to server ?
json~
thanks for your help!
i have write client connect server , but i don't know how to send packet to server ?
i am require to play the RTP (audio) packet that are comming from the RTP server throught UDP connection ,
how to send RTP packet to server inorder to reply the packet loss to client ?
As simple example have a look at http://java.sun.com/docs/books/tutor...verThread.java
Here is an extract of the code.
public void run() { while (moreQuotes) { try { byte[] buf = new byte[256]; // receive request DatagramPacket packet = new DatagramPacket(buf, buf.length); socket.receive(packet); // figure out response String dString = null; if (in == null) dString = new Date().toString(); else dString = getNextQuote(); buf = dString.getBytes(); // send the response to the client at "address" and "port" InetAddress address = packet.getAddress(); int port = packet.getPort(); packet = new DatagramPacket(buf, buf.length, address, port); socket.send(packet); } catch (IOException e) { e.printStackTrace(); moreQuotes = false; } } socket.close(); }
Above you can see that it takes a string in this case and puts it in the byte array buffer called buf. It then creates a DatagramPacket using this buf variable and then it sends the packet off using the socket.send method.
What you need to do us open up a stream to your file, read the file and while you are reading it, pass the data of the stream out as packets to the socket.
// Json
json :
thanks for you help!
but i am require to play the RTP (audio) packet that are comming from the RTP server throught UDP connection , do you have any example about this ?To the best of my knowledge , it's looks like have to using JMF , but i don't know how to using jmf ?