blob: c2b10ddfcdf8132baaa7ad7c64aa225bac3d56e8 [file]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Apache log4cxx: Socket Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.6 -->
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li id="current"><a href="classes.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul></div>
<div class="tabs">
<ul>
<li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul></div>
<div class="nav">
<a class="el" href="namespacelog4cxx.html">log4cxx</a>::<a class="el" href="namespacelog4cxx_1_1helpers.html">helpers</a>::<a class="el" href="classlog4cxx_1_1helpers_1_1_socket.html">Socket</a></div>
<h1>Socket Class Reference</h1><!-- doxytag: class="log4cxx::helpers::Socket" --><!-- doxytag: inherits="log4cxx::helpers::ObjectImpl" -->Inherits <a class="el" href="classlog4cxx_1_1helpers_1_1_object_impl.html">ObjectImpl</a>.
<p>
<a href="classlog4cxx_1_1helpers_1_1_socket-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
This class implements client sockets (also called just "sockets"). A socket is an endpoint for communication between two machines. <p>
The actual work of the socket is performed by an instance of the SocketImpl class. An application, by changing the socket factory that creates the socket implementation, can configure itself to create sockets appropriate to the local firewall.
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_socket.html#6eb84c53d1965e4bc16875586e378e75">Socket</a> (InetAddressPtr &amp;address, int port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a stream socket and connects it to the specified port number at the specified IP address. <a href="#6eb84c53d1965e4bc16875586e378e75"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_socket.html#faf523630d1fa1424374e59a57178467">Socket</a> (apr_socket_t *socket, apr_pool_t *pool)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_socket.html#f387aca495ea9a25c511cd7d02d997bb">~Socket</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_socket.html#96532612549685312a628c2825130b21">write</a> (<a class="el" href="classlog4cxx_1_1helpers_1_1_byte_buffer.html">ByteBuffer</a> &amp;)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_socket.html#5ae591df94fc66ccb85cbb6565368bca">close</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Closes this socket. <a href="#5ae591df94fc66ccb85cbb6565368bca"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">InetAddressPtr&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_socket.html#bbfdb429dc48519dec0010ffeced144a">getInetAddress</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the value of this socket's address field. <a href="#bbfdb429dc48519dec0010ffeced144a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_socket.html#5e4fc3488ccbe0511b7e7a1b3ca873cf">getPort</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the value of this socket's port field. <a href="#5e4fc3488ccbe0511b7e7a1b3ca873cf"></a><br></td></tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="6eb84c53d1965e4bc16875586e378e75"></a><!-- doxytag: member="log4cxx::helpers::Socket::Socket" ref="6eb84c53d1965e4bc16875586e378e75" args="(InetAddressPtr &amp;address, int port)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="classlog4cxx_1_1helpers_1_1_socket.html">Socket</a> </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">InetAddressPtr &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>address</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>port</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Creates a stream socket and connects it to the specified port number at the specified IP address.
<p>
</td>
</tr>
</table>
<a class="anchor" name="faf523630d1fa1424374e59a57178467"></a><!-- doxytag: member="log4cxx::helpers::Socket::Socket" ref="faf523630d1fa1424374e59a57178467" args="(apr_socket_t *socket, apr_pool_t *pool)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="classlog4cxx_1_1helpers_1_1_socket.html">Socket</a> </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">apr_socket_t *&nbsp;</td>
<td class="mdname" nowrap> <em>socket</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>apr_pool_t *&nbsp;</td>
<td class="mdname" nowrap> <em>pool</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="f387aca495ea9a25c511cd7d02d997bb"></a><!-- doxytag: member="log4cxx::helpers::Socket::~Socket" ref="f387aca495ea9a25c511cd7d02d997bb" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">~<a class="el" href="classlog4cxx_1_1helpers_1_1_socket.html">Socket</a> </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="5ae591df94fc66ccb85cbb6565368bca"></a><!-- doxytag: member="log4cxx::helpers::Socket::close" ref="5ae591df94fc66ccb85cbb6565368bca" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void close </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Closes this socket.
<p>
</td>
</tr>
</table>
<a class="anchor" name="bbfdb429dc48519dec0010ffeced144a"></a><!-- doxytag: member="log4cxx::helpers::Socket::getInetAddress" ref="bbfdb429dc48519dec0010ffeced144a" args="() const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">InetAddressPtr getInetAddress </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns the value of this socket's address field.
<p>
</td>
</tr>
</table>
<a class="anchor" name="5e4fc3488ccbe0511b7e7a1b3ca873cf"></a><!-- doxytag: member="log4cxx::helpers::Socket::getPort" ref="5e4fc3488ccbe0511b7e7a1b3ca873cf" args="() const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int getPort </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns the value of this socket's port field.
<p>
</td>
</tr>
</table>
<a class="anchor" name="96532612549685312a628c2825130b21"></a><!-- doxytag: member="log4cxx::helpers::Socket::write" ref="96532612549685312a628c2825130b21" args="(ByteBuffer &amp;)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">size_t write </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="classlog4cxx_1_1helpers_1_1_byte_buffer.html">ByteBuffer</a> &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="socket_8h.html">socket.h</a></ul>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
</BODY>
</HTML>