On Mon, 05 Mar 2007 13:36:15 +0100, Giulio Petrucci wrote:
Mehdi ha scritto:
>RTP/RTSP are documented, standard protocols that are usually implemented
over UDP although you can implements them over TCP or other protocols if
you want.
I need to implementi it over TCN necessarily.
I suppose that you mean TCP? Keep in mind that most real-time audio-video
systems are implemented on top of UDP rather than TCP as obviously UDP is
better suited for the task (although UDP also introduces loads of
additional problems). If you're going to do that on top of TCP, you'll need
to remember that TCP ensures that all the packets you send on the network
are received and are received in the proper order. This a good in a sense
as it means that you do not have to worry about missing or out-of-order
packets but that means that if a packets fails to be received, TCP will
keep re-sending it until it is received by the other end, hence introducing
delay which is very bad in the case of a real-time AV system. You'll need
to code to detect such delay build-up and reduce it.
You might also want to disable the Nagle algorithm on your Socket if you
want to do real-time communication over TCP.
>For an example implementation in .NET, have a look at Microsoft's open
source Conference XP project <http://research.microsoft.com/conferencexp/>
Note that their RTP stack is not fully standard compliant though but in
case you need re-assurance that it works, then this is the proof you need.
I searched but found nothing interesting (well, I should say "I found
nothing" at all :-( ). Please, could you paste here some more detailed
links?
Conference XP is a project aimed at providing an extensible framework for
high quality audio/video conferencing. It also has other features such as
text chat, slide sharing, etc. They are using RTP over multicast UDP for
all the network communications. You can download the source code from the
main page <http://research.microsoft.com/conferencexp/>. There are several
solution and projects in there, one of which is their network stack
implementing their own non-standard-compliant RTP stack. I don't remember
how it's called, probably RTP- or Network-something. Although you probably
won't be able to re-use much or any of their code (which can not be used
for commercial purposes by the way), it should give you an idea of what
implementing RTP in .NET can look like.
You might be interested in this video as well:
<http://research.microsoft.com/conferencexp/library/workshop2005/videos/12424/default.htm>
(taken from their ressources page
<http://research.microsoft.com/conferencexp/resources_library.aspx>). It
presents an overview of Conference XP. In particular, at around 48 minutes
into the video, Jason gives a short introduction to RTP and explains how
they've implemented it in Conference XP. If you're new to RTP, this might
be useful.
Actually I can use async socket (I always use them when I can), but what
about the RT then? Shall I use it the same?
Real-time in this case simply means trying to achieve as low latency as
possible. And that has pretty much nothing to do with
synchronous/asynchronous. If you're comfortable already with asynchronous
socket programming then go for it espcially if you want you RTP stack to be
able to scale up to more than a few clients.