Current File : //usr/share/doc/dbus/api/group__DBusTransportSocket.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>D-Bus: DBusTransport implementations for sockets</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">D-Bus
   &#160;<span id="projectnumber">1.8.20</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">DBusTransport implementations for sockets</div>  </div>
<div class="ingroups"><a class="el" href="group__DBusInternals.html">D-Bus secret internal implementation details</a></div></div><!--header-->
<div class="contents">

<p>Implementation details of <a class="el" href="structDBusTransport.html" title="Object representing a transport such as a socket.">DBusTransport</a> on sockets.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structDBusTransportSocket.html">DBusTransportSocket</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Implementation details of <a class="el" href="structDBusTransportSocket.html" title="Implementation details of DBusTransportSocket.">DBusTransportSocket</a>.  <a href="structDBusTransportSocket.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga762346435786136b694d19a9bc5bce37"></a><!-- doxytag: member="DBusTransportSocket::DBusTransportSocket" ref="ga762346435786136b694d19a9bc5bce37" args="" -->
typedef struct <a class="el" href="structDBusTransportSocket.html">DBusTransportSocket</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusTransportSocket.html#ga762346435786136b694d19a9bc5bce37">DBusTransportSocket</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opaque object representing a socket file descriptor transport. <br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structDBusTransport.html">DBusTransport</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusTransportSocket.html#gac714eaa33ff4ab5c01be1304b23339a7">_dbus_transport_new_for_socket</a> (int fd, const <a class="el" href="structDBusString.html">DBusString</a> *server_guid, const <a class="el" href="structDBusString.html">DBusString</a> *address)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new transport for the given socket file descriptor.  <a href="#gac714eaa33ff4ab5c01be1304b23339a7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structDBusTransport.html">DBusTransport</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusTransportSocket.html#ga166dbf1d38f06321025408167d214860">_dbus_transport_new_for_tcp_socket</a> (const char *host, const char *port, const char *family, const char *noncefile, <a class="el" href="structDBusError.html">DBusError</a> *error)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new transport for the given hostname and port.  <a href="#ga166dbf1d38f06321025408167d214860"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">DBusTransportOpenResult&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusTransportSocket.html#ga1bb28d9c6b0aa2b7efdf63f97116bb85">_dbus_transport_open_socket</a> (<a class="el" href="structDBusAddressEntry.html">DBusAddressEntry</a> *entry, <a class="el" href="structDBusTransport.html">DBusTransport</a> **transport_p, <a class="el" href="structDBusError.html">DBusError</a> *error)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opens a TCP socket transport.  <a href="#ga1bb28d9c6b0aa2b7efdf63f97116bb85"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Implementation details of <a class="el" href="structDBusTransport.html" title="Object representing a transport such as a socket.">DBusTransport</a> on sockets. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gac714eaa33ff4ab5c01be1304b23339a7"></a><!-- doxytag: member="dbus&#45;transport&#45;socket.c::_dbus_transport_new_for_socket" ref="gac714eaa33ff4ab5c01be1304b23339a7" args="(int fd, const DBusString *server_guid, const DBusString *address)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structDBusTransport.html">DBusTransport</a>* <a class="el" href="group__DBusTransportSocket.html#gac714eaa33ff4ab5c01be1304b23339a7">_dbus_transport_new_for_socket</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structDBusString.html">DBusString</a> *&#160;</td>
          <td class="paramname"><em>server_guid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structDBusString.html">DBusString</a> *&#160;</td>
          <td class="paramname"><em>address</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a new transport for the given socket file descriptor. </p>
<p>The file descriptor must be nonblocking (use _dbus_set_fd_nonblocking() to make it so). This function is shared by various transports that boil down to a full duplex file descriptor.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">fd</td><td>the file descriptor. </td></tr>
    <tr><td class="paramname">server_guid</td><td>non-<a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if this transport is on the server side of a connection </td></tr>
    <tr><td class="paramname">address</td><td>the transport's address </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the new transport, or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if no memory. </dd></dl>

<p>Definition at line <a class="el" href="dbus-transport-socket_8c_source.html#l01256">1256</a> of file <a class="el" href="dbus-transport-socket_8c_source.html">dbus-transport-socket.c</a>.</p>

<p>References <a class="el" href="dbus-auth_8c_source.html#l02789">_dbus_auth_set_unix_fd_possible()</a>, <a class="el" href="dbus-sysdeps-unix_8c_source.html#l03934">_dbus_socket_can_pass_unix_fd()</a>, <a class="el" href="dbus-string_8c_source.html#l00242">_dbus_string_free()</a>, <a class="el" href="dbus-string_8c_source.html#l00175">_dbus_string_init()</a>, <a class="el" href="dbus-transport_8c_source.html#l00102">_dbus_transport_init_base()</a>, <a class="el" href="dbus-watch_8c_source.html#l00169">_dbus_watch_invalidate()</a>, <a class="el" href="dbus-watch_8c_source.html#l00088">_dbus_watch_new()</a>, <a class="el" href="dbus-watch_8c_source.html#l00138">_dbus_watch_unref()</a>, <a class="el" href="dbus-transport-protected_8h_source.html#l00090">DBusTransport::auth</a>, <a class="el" href="dbus-transport-socket_8c_source.html#l00051">base</a>, <a class="el" href="dbus-memory_8c_source.html#l00701">dbus_free()</a>, <a class="el" href="dbus-memory_8h_source.html#l00059">dbus_new0</a>, <a class="el" href="dbus-transport-socket_8c_source.html#l00066">encoded_incoming</a>, <a class="el" href="dbus-transport-socket_8c_source.html#l00063">encoded_outgoing</a>, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1">FALSE</a>, <a class="el" href="dbus-transport-socket_8c_source.html#l00052">fd</a>, <a class="el" href="dbus-transport-socket_8c_source.html#l00056">max_bytes_read_per_iteration</a>, <a class="el" href="dbus-transport-socket_8c_source.html#l00057">max_bytes_written_per_iteration</a>, <a class="el" href="dbus-transport-socket_8c_source.html#l00059">message_bytes_written</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, <a class="el" href="dbus-transport-socket_8c_source.html#l00053">read_watch</a>, and <a class="el" href="dbus-transport-socket_8c_source.html#l00054">write_watch</a>.</p>

<p>Referenced by <a class="el" href="dbus-transport-unix_8c_source.html#l00058">_dbus_transport_new_for_domain_socket()</a>, and <a class="el" href="dbus-transport-socket_8c_source.html#l01331">_dbus_transport_new_for_tcp_socket()</a>.</p>

</div>
</div>
<a class="anchor" id="ga166dbf1d38f06321025408167d214860"></a><!-- doxytag: member="dbus&#45;transport&#45;socket.c::_dbus_transport_new_for_tcp_socket" ref="ga166dbf1d38f06321025408167d214860" args="(const char *host, const char *port, const char *family, const char *noncefile, DBusError *error)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structDBusTransport.html">DBusTransport</a>* <a class="el" href="group__DBusTransportSocket.html#ga166dbf1d38f06321025408167d214860">_dbus_transport_new_for_tcp_socket</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>family</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>noncefile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structDBusError.html">DBusError</a> *&#160;</td>
          <td class="paramname"><em>error</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a new transport for the given hostname and port. </p>
<p>If host is NULL, it will default to localhost</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">host</td><td>the host to connect to </td></tr>
    <tr><td class="paramname">port</td><td>the port to connect to </td></tr>
    <tr><td class="paramname">family</td><td>the address family to connect to </td></tr>
    <tr><td class="paramname">noncefile</td><td>path to nonce file </td></tr>
    <tr><td class="paramname">error</td><td>location to store reason for failure. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a new transport, or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> on failure. </dd></dl>

<p>Definition at line <a class="el" href="dbus-transport-socket_8c_source.html#l01331">1331</a> of file <a class="el" href="dbus-transport-socket_8c_source.html">dbus-transport-socket.c</a>.</p>

<p>References <a class="el" href="dbus-sysdeps-unix_8c_source.html#l00202">_dbus_close_socket()</a>, <a class="el" href="dbus-string_8c_source.html#l00918">_dbus_string_append()</a>, <a class="el" href="dbus-string_8c_source.html#l00242">_dbus_string_free()</a>, <a class="el" href="dbus-string_8c_source.html#l00175">_dbus_string_init()</a>, <a class="el" href="dbus-transport-socket_8c_source.html#l01256">_dbus_transport_new_for_socket()</a>, <a class="el" href="dbus-protocol_8h_source.html#l00352">DBUS_ERROR_NO_MEMORY</a>, <a class="el" href="dbus-errors_8c_source.html#l00354">dbus_set_error()</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>

<p>Referenced by <a class="el" href="dbus-transport-socket_8c_source.html#l01410">_dbus_transport_open_socket()</a>.</p>

</div>
</div>
<a class="anchor" id="ga1bb28d9c6b0aa2b7efdf63f97116bb85"></a><!-- doxytag: member="dbus&#45;transport&#45;socket.c::_dbus_transport_open_socket" ref="ga1bb28d9c6b0aa2b7efdf63f97116bb85" args="(DBusAddressEntry *entry, DBusTransport **transport_p, DBusError *error)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DBusTransportOpenResult <a class="el" href="group__DBusTransportSocket.html#ga1bb28d9c6b0aa2b7efdf63f97116bb85">_dbus_transport_open_socket</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structDBusAddressEntry.html">DBusAddressEntry</a> *&#160;</td>
          <td class="paramname"><em>entry</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structDBusTransport.html">DBusTransport</a> **&#160;</td>
          <td class="paramname"><em>transport_p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structDBusError.html">DBusError</a> *&#160;</td>
          <td class="paramname"><em>error</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Opens a TCP socket transport. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">entry</td><td>the address entry to try opening as a tcp transport. </td></tr>
    <tr><td class="paramname">transport_p</td><td>return location for the opened transport </td></tr>
    <tr><td class="paramname">error</td><td>error to be set </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>result of the attempt </dd></dl>

<p>Definition at line <a class="el" href="dbus-transport-socket_8c_source.html#l01410">1410</a> of file <a class="el" href="dbus-transport-socket_8c_source.html">dbus-transport-socket.c</a>.</p>

<p>References <a class="el" href="dbus-address_8c_source.html#l00065">_dbus_set_bad_address()</a>, <a class="el" href="dbus-transport-socket_8c_source.html#l01331">_dbus_transport_new_for_tcp_socket()</a>, <a class="el" href="dbus-address_8c_source.html#l00227">dbus_address_entry_get_method()</a>, <a class="el" href="dbus-address_8c_source.html#l00244">dbus_address_entry_get_value()</a>, <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, and <a class="el" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>.</p>

</div>
</div>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Thu Mar 3 2016 17:50:34 for D-Bus by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>