1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
5
>Multiplexing sessions (in a one thread design)</TITLE
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
10
TITLE="oRTP Reference Manual"
11
HREF="book1.html"><LINK
14
HREF="ortpapi.html"><LINK
16
TITLE="RTP payloads and profiles"
17
HREF="ortp-rtp-payloads-and-profiles.html"><LINK
19
TITLE="Telephone events (RFC2833)"
20
HREF="ortp-telephone-events---rfc2833-.html"><STYLE
22
>.synopsis, .classsynopsis {
24
border: solid 1px #aaaaaa;
29
border: solid 1px #aaaaff;
38
border: solid 1px #ffaaaa;
45
.navigation a:visited {
62
SUMMARY="Navigation header"
70
HREF="ortp-rtp-payloads-and-profiles.html"
103
>oRTP Reference Manual</TH
107
HREF="ortp-telephone-events---rfc2833-.html"
119
NAME="ORTP-MULTIPLEXING-SESSIONS---IN-A-ONE-THREAD-DESIGN"
121
>Multiplexing sessions (in a one thread design)</H1
129
>Multiplexing sessions (in a one thread design) -- The SessionSet API allows applications to make I/O on mutilple rtp sessions
130
without making blocking I/O, but keeping the main process synchronised.</DIV
132
CLASS="REFSYNOPSISDIV"
140
> #include <ortp.h>
144
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
148
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
151
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSION-SET-NEW"
155
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSION-SET-INIT"
159
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSION-SET-SET"
163
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSION-SET-IS-SET"
164
>session_set_is_set</A
167
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSION-SET-CLR"
171
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSION-SET-SELECT"
172
>session_set_select</A
174
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
178
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
182
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
186
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSION-SET-DESTROY"
187
>session_set_destroy</A
189
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
201
>The scheduled mode must be enabled for all rtp session that are managed through the
202
SessionSet API. See <A
203
HREF="ortp-rtpsession-api.html#RTP-SESSION-SET-SCHEDULING-MODE"
206
>rtp_session_set_scheduling_mode()</CODE
228
CLASS="PROGRAMLISTING"
242
NAME="SESSION-SET-NEW"
244
>session_set_new ()</H3
246
CLASS="PROGRAMLISTING"
248
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
250
>* session_set_new ();</PRE
252
>Allocates and initialize a new empty session set.</P
269
STYLE="white-space: nowrap"
282
> the session set.</P
295
NAME="SESSION-SET-INIT"
297
>session_set_init()</H3
299
CLASS="PROGRAMLISTING"
300
>#define session_set_init(ss) ORTP_FD_ZERO(&(ss)->rtpset)</PRE
302
>Initializes a session set. It is unusefull to call this function on a session set object
304
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSION-SET-NEW"
307
>session_set_new()</CODE
326
STYLE="white-space: nowrap"
336
> a SessionSet statically allocated.</P
349
NAME="SESSION-SET-SET"
351
>session_set_set()</H3
353
CLASS="PROGRAMLISTING"
354
>#define session_set_set(ss,rtpsession) ORTP_FD_SET((rtpsession)->mask_pos,&(ss)->rtpset)</PRE
356
>This macro adds rtp session <CODE
379
STYLE="white-space: nowrap"
390
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
404
STYLE="white-space: nowrap"
427
NAME="SESSION-SET-IS-SET"
429
>session_set_is_set()</H3
431
CLASS="PROGRAMLISTING"
432
>#define session_set_is_set(ss,rtpsession) ORTP_FD_ISSET((rtpsession)->mask_pos,&(ss)->rtpset)</PRE
434
>This macro tests if <CODE
440
>. 1 is returned if true, 0 else.</P
457
STYLE="white-space: nowrap"
468
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
482
STYLE="white-space: nowrap"
505
NAME="SESSION-SET-CLR"
507
>session_set_clr()</H3
509
CLASS="PROGRAMLISTING"
510
>#define session_set_clr(ss,rtpsession) ORTP_FD_CLR((rtpsession)->mask_pos,&(ss)->rtpset)</PRE
532
STYLE="white-space: nowrap"
542
> a set of sessions.</P
551
STYLE="white-space: nowrap"
574
NAME="SESSION-SET-SELECT"
576
>session_set_select ()</H3
578
CLASS="PROGRAMLISTING"
579
>int session_set_select (<A
580
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
584
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
588
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
592
>This function performs similarly as libc <GTKDOCLINK
598
> function, but performs on <A
599
HREF="ortp-rtpsession-api.html#RTPSESSION"
605
instead of file descriptors.
607
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSION-SET-SELECT"
610
>session_set_select()</CODE
612
> suspends the calling process until some events arrive on one of the
613
three sets passed in argument. Two of the sets can be NULL.
617
> is interpreted as a set of RtpSession waiting for receive events:
618
a new buffer (perhaps empty) is availlable on one or more sessions of the set, or the last
619
receive operation with <A
620
HREF="ortp-rtpsession-api.html#RTP-SESSION-RECV-WITH-TS"
623
>rtp_session_recv_with_ts()</CODE
625
> would have finished if it were in
627
The second set is interpreted as a set of RtpSession waiting for send events, i.e. the last
629
HREF="ortp-rtpsession-api.html#RTP-SESSION-SEND-WITH-TS"
632
>rtp_session_send_with_ts()</CODE
634
> call on a session would have finished if it were in blocking mode.</P
636
>When some events arrived on some of sets, then the function returns and sets are changed
637
to indicate the sessions where events happened.
638
Sessions can be added to sets using <A
639
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSION-SET-SET"
642
>session_set_set()</CODE
644
>, a session has to be tested to be
645
part of a set using <A
646
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSION-SET-IS-SET"
649
>session_set_is_set()</CODE
668
STYLE="white-space: nowrap"
678
> a set of rtp sessions to be watched for read events</P
687
STYLE="white-space: nowrap"
697
> a set of rtp sessions to be watched for write events</P
706
STYLE="white-space: nowrap"
716
> a set of rtp sessions to be watched for errors</P
725
STYLE="white-space: nowrap"
738
> the number of sessions on which the selected events happened.</P
751
NAME="SESSION-SET-DESTROY"
753
>session_set_destroy ()</H3
755
CLASS="PROGRAMLISTING"
756
>void session_set_destroy (<A
757
HREF="ortp-multiplexing-sessions---in-a-one-thread-design.html#SESSIONSET"
778
STYLE="white-space: nowrap"
789
Destroys a session set.</P
804
>See the mrtprecv.c and mrtpsend.c programs included in the library that uses
805
the SessionSet API to send or receive multiple RTP streams in one thread design.</P
810
SUMMARY="Navigation footer"
819
HREF="ortp-rtp-payloads-and-profiles.html"
821
><<< RTP payloads and profiles</B
828
HREF="ortp-telephone-events---rfc2833-.html"
830
>Telephone events (RFC2833) >>></B
b'\\ No newline at end of file'