Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 598246a3099b0106d22dd5249478d3b7 > files > 158

ccrtp-devel-1.7.1-2.fc12.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ccRTP: ext.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>ext.h</h1><a href="ext_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 1999-2003 Open Source Telecom Corporation.</span>
<a name="l00002"></a>00002 <span class="comment">//  </span>
<a name="l00003"></a>00003 <span class="comment">// This program is free software; you can redistribute it and/or modify</span>
<a name="l00004"></a>00004 <span class="comment">// it under the terms of the GNU General Public License as published by</span>
<a name="l00005"></a>00005 <span class="comment">// the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00006"></a>00006 <span class="comment">// (at your option) any later version.</span>
<a name="l00007"></a>00007 <span class="comment">// </span>
<a name="l00008"></a>00008 <span class="comment">// This program is distributed in the hope that it will be useful,</span>
<a name="l00009"></a>00009 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00010"></a>00010 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00011"></a>00011 <span class="comment">// GNU General Public License for more details.</span>
<a name="l00012"></a>00012 <span class="comment">// </span>
<a name="l00013"></a>00013 <span class="comment">// You should have received a copy of the GNU General Public License</span>
<a name="l00014"></a>00014 <span class="comment">// along with this program; if not, write to the Free Software </span>
<a name="l00015"></a>00015 <span class="comment">// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</span>
<a name="l00016"></a>00016 <span class="comment">// </span>
<a name="l00017"></a>00017 <span class="comment">// As a special exception, you may use this file as part of a free software</span>
<a name="l00018"></a>00018 <span class="comment">// library without restriction.  Specifically, if other files instantiate</span>
<a name="l00019"></a>00019 <span class="comment">// templates or use macros or inline functions from this file, or you compile</span>
<a name="l00020"></a>00020 <span class="comment">// this file and link it with other files to produce an executable, this</span>
<a name="l00021"></a>00021 <span class="comment">// file does not by itself cause the resulting executable to be covered by</span>
<a name="l00022"></a>00022 <span class="comment">// the GNU General Public License.  This exception does not however    </span>
<a name="l00023"></a>00023 <span class="comment">// invalidate any other reasons why the executable file might be covered by</span>
<a name="l00024"></a>00024 <span class="comment">// the GNU General Public License.    </span>
<a name="l00025"></a>00025 <span class="comment">//</span>
<a name="l00026"></a>00026 <span class="comment">// This exception applies only to the code released under the name GNU</span>
<a name="l00027"></a>00027 <span class="comment">// ccRTP.  If you copy code from other releases into a copy of GNU</span>
<a name="l00028"></a>00028 <span class="comment">// ccRTP, as the General Public License permits, the exception does</span>
<a name="l00029"></a>00029 <span class="comment">// not apply to the code that you add in this way.  To avoid misleading</span>
<a name="l00030"></a>00030 <span class="comment">// anyone as to the status of such modified files, you must delete</span>
<a name="l00031"></a>00031 <span class="comment">// this exception notice from them.</span>
<a name="l00032"></a>00032 <span class="comment">//</span>
<a name="l00033"></a>00033 <span class="comment">// If you write modifications of your own for GNU ccRTP, it is your choice</span>
<a name="l00034"></a>00034 <span class="comment">// whether to permit this exception to apply to your modifications.</span>
<a name="l00035"></a>00035 <span class="comment">// If you do not wish that, delete this exception notice.</span>
<a name="l00036"></a>00036 <span class="comment">//</span>
<a name="l00037"></a>00037 
<a name="l00043"></a>00043 <span class="preprocessor">#ifndef CCXX_RTP_EXT_H</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#define CCXX_RTP_EXT_H</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span>
<a name="l00046"></a>00046 <span class="preprocessor">#ifndef CCXX_SOCKET_H_</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#include &lt;cc++/socket.h&gt;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#endif</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span>
<a name="l00050"></a>00050 <span class="preprocessor">#include &lt;<a class="code" href="ioqueue_8h.html" title="Generic RTP input/output queues.">ccrtp/ioqueue.h</a>&gt;</span>
<a name="l00051"></a>00051 <span class="preprocessor">#include &lt;<a class="code" href="channel_8h.html" title="Definition of socket classes for different underlying transport and/or network protocols...">ccrtp/channel.h</a>&gt;</span>
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <span class="preprocessor">#ifdef  CCXX_NAMESPACES</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="keyword">namespace </span>ost {
<a name="l00055"></a>00055 <span class="preprocessor">#endif</span>
<a name="l00056"></a>00056 <span class="preprocessor"></span>
<a name="l00072"></a><a class="code" href="class_r_t_p_duplex.html">00072</a> <span class="keyword">class </span>__EXPORT <a class="code" href="class_r_t_p_duplex.html" title="A peer associated RTP socket pair for physically connected peer hosts.">RTPDuplex</a> : <span class="keyword">public</span> <a class="code" href="class_r_t_p_data_queue.html" title="A packet queue handler for building different kinds of RTP protocol systems.">RTPDataQueue</a>, 
<a name="l00073"></a>00073                                     <span class="keyword">protected</span> UDPReceive, <span class="keyword">public</span> UDPTransmit
<a name="l00074"></a>00074 {
<a name="l00075"></a>00075 <span class="keyword">public</span>:
<a name="l00081"></a>00081         <a class="code" href="class_r_t_p_duplex.html" title="A peer associated RTP socket pair for physically connected peer hosts.">RTPDuplex</a>(<span class="keyword">const</span> InetAddress &amp;bind, tpport_t local, tpport_t remote);
<a name="l00082"></a>00082 
<a name="l00086"></a>00086         <span class="keyword">virtual</span>
<a name="l00087"></a>00087         ~<a class="code" href="class_r_t_p_duplex.html" title="A peer associated RTP socket pair for physically connected peer hosts.">RTPDuplex</a>();
<a name="l00088"></a>00088 
<a name="l00095"></a>00095         UDPTransmit::Error 
<a name="l00096"></a>00096         connect(<span class="keyword">const</span> InetHostAddress &amp;host, tpport_t port = 0);
<a name="l00097"></a>00097 
<a name="l00098"></a>00098 <span class="keyword">protected</span>:
<a name="l00099"></a>00099 
<a name="l00104"></a>00104         <span class="keywordtype">bool</span> 
<a name="l00105"></a><a class="code" href="class_r_t_p_duplex.html#48eea122a1f60c696a5b181ee56ceeef">00105</a>         isPendingData(<a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> timeout)
<a name="l00106"></a>00106         { <span class="keywordflow">return</span> isPendingReceive(timeout); }
<a name="l00107"></a>00107 
<a name="l00113"></a>00113         <span class="keywordtype">size_t</span> 
<a name="l00114"></a><a class="code" href="class_r_t_p_duplex.html#ebfc491272d576a5d79a0ff499daafcc">00114</a>         sendData(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> buffer, <span class="keywordtype">size_t</span> len)
<a name="l00115"></a>00115         { <span class="keywordflow">return</span> UDPTransmit::transmit((<span class="keyword">const</span> <span class="keywordtype">char</span> *)buffer, len); }
<a name="l00116"></a>00116 
<a name="l00124"></a>00124         <span class="keywordtype">size_t</span>
<a name="l00125"></a><a class="code" href="class_r_t_p_duplex.html#bb5f6c2e9c218c0cf1ab40d1ffae24ad">00125</a>         recvData(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buffer, <span class="keywordtype">size_t</span> len, 
<a name="l00126"></a>00126                  InetHostAddress&amp; na, tpport_t&amp; tp)
<a name="l00127"></a>00127         { <span class="comment">/* na = UDPReceive::getPeer(&amp;tp);  FIX name ambiguity */</span>
<a name="l00128"></a>00128         <span class="keywordflow">return</span> UDPReceive::receive(buffer, len); }
<a name="l00129"></a>00129         
<a name="l00134"></a>00134         <span class="keyword">inline</span> <span class="keywordtype">void</span>
<a name="l00135"></a><a class="code" href="class_r_t_p_duplex.html#809ca7d773a477897b89d25480d2f4bf">00135</a>         setDataPeer(<span class="keyword">const</span> InetAddress&amp;, tpport_t)
<a name="l00136"></a>00136         { }
<a name="l00137"></a>00137 
<a name="l00142"></a>00142         <span class="keyword">inline</span> <span class="keywordtype">void</span>
<a name="l00143"></a><a class="code" href="class_r_t_p_duplex.html#5ff45b797428c956156a4a965f318d03">00143</a>         setControlPeer(<span class="keyword">const</span> InetAddress&amp;, tpport_t)
<a name="l00144"></a>00144         { }
<a name="l00145"></a>00145 
<a name="l00146"></a>00146         <span class="keyword">inline</span> <span class="keywordtype">size_t</span>
<a name="l00147"></a><a class="code" href="class_r_t_p_duplex.html#d23a35fc2e42bb04d354fe8c8c9b2471">00147</a>         getNextDataPacketSize()<span class="keyword"> const</span>
<a name="l00148"></a>00148 <span class="keyword">        </span>{
<a name="l00149"></a>00149                 <span class="comment">// the const cast is a trick only needed for cc++2 &lt;= 1.0.10</span>
<a name="l00150"></a>00150                 <span class="keywordtype">size_t</span> len; <a class="code" href="channel_8h.html#e446f38679316c3a6922cb60c2b4c1e0">ccioctl</a>(const_cast&lt;RTPDuplex*&gt;(<span class="keyword">this</span>)-&gt;UDPReceive::getReceiver(),FIONREAD,len); <span class="keywordflow">return</span> len; 
<a name="l00151"></a>00151         }
<a name="l00152"></a>00152 
<a name="l00156"></a>00156         <a class="code" href="class_sync_source.html" title="Synchronization source in an RTP session.">SyncSource</a> &amp;getPeer();
<a name="l00157"></a>00157 
<a name="l00158"></a>00158 <span class="keyword">private</span>:
<a name="l00159"></a>00159         tpport_t dataBasePort;
<a name="l00160"></a>00160 };
<a name="l00161"></a>00161  <span class="comment">// rtpext</span>
<a name="l00163"></a>00163 
<a name="l00164"></a>00164 <span class="preprocessor">#ifdef  CCXX_NAMESPACES</span>
<a name="l00165"></a>00165 <span class="preprocessor"></span>}
<a name="l00166"></a>00166 <span class="preprocessor">#endif</span>
<a name="l00167"></a>00167 <span class="preprocessor"></span>
<a name="l00168"></a>00168 <span class="preprocessor">#endif //CCXX_RTP_EXT_H</span>
<a name="l00169"></a>00169 <span class="preprocessor"></span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jul 24 21:42:25 2009 for ccRTP by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>