1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
|
<!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>
<title>Class Poco::Net::Socket</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.Net.html" class="namespace">Poco::Net</a></h1>
<h1 class="symbol">class Socket</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Net<br />
<b>Package:</b> Sockets<br />
<b>Header:</b> Poco/Net/Socket.h</p>
<h2>Description</h2>
<div class="description">
<p><a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> is the common base class for <a href="Poco.Net.StreamSocket.html" title="class Poco::Net::StreamSocket">StreamSocket</a>, <a href="Poco.Net.ServerSocket.html" title="class Poco::Net::ServerSocket">ServerSocket</a>, <a href="Poco.Net.DatagramSocket.html" title="class Poco::Net::DatagramSocket">DatagramSocket</a> and other socket classes. </p>
<p>It provides operations common to all socket types. </p>
</div>
<h2>Inheritance</h2>
<p><b>Known Derived Classes: </b><a href="Poco.Net.DatagramSocket.html" title="class Poco::Net::DatagramSocket">DatagramSocket</a>, <a href="Poco.Net.DialogSocket.html" title="class Poco::Net::DialogSocket">DialogSocket</a>, <a href="Poco.Net.ICMPSocket.html" title="class Poco::Net::ICMPSocket">ICMPSocket</a>, <a href="Poco.Net.MulticastSocket.html" title="class Poco::Net::MulticastSocket">MulticastSocket</a>, <a href="Poco.Net.RawSocket.html" title="class Poco::Net::RawSocket">RawSocket</a>, <a href="Poco.Net.ServerSocket.html" title="class Poco::Net::ServerSocket">ServerSocket</a>, <a href="Poco.Net.StreamSocket.html" title="class Poco::Net::StreamSocket">StreamSocket</a>, <a href="Poco.Net.SecureServerSocket.html" title="class Poco::Net::SecureServerSocket">SecureServerSocket</a>, <a href="Poco.Net.SecureStreamSocket.html" title="class Poco::Net::SecureStreamSocket">SecureStreamSocket</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Net.Socket.html#15077" title="Poco::Net::Socket::address()">address</a>, <a href="Poco.Net.Socket.html#15000" title="Poco::Net::Socket::available()">available</a>, <a href="Poco.Net.Socket.html#14991" title="Poco::Net::Socket::close()">close</a>, <a href="Poco.Net.Socket.html#15076" title="Poco::Net::Socket::getBlocking()">getBlocking</a>, <a href="Poco.Net.Socket.html#15064" title="Poco::Net::Socket::getKeepAlive()">getKeepAlive</a>, <a href="Poco.Net.Socket.html#15056" title="Poco::Net::Socket::getLinger()">getLinger</a>, <a href="Poco.Net.Socket.html#15061" title="Poco::Net::Socket::getNoDelay()">getNoDelay</a>, <a href="Poco.Net.Socket.html#15073" title="Poco::Net::Socket::getOOBInline()">getOOBInline</a>, <a href="Poco.Net.Socket.html#15033" title="Poco::Net::Socket::getOption()">getOption</a>, <a href="Poco.Net.Socket.html#15006" title="Poco::Net::Socket::getReceiveBufferSize()">getReceiveBufferSize</a>, <a href="Poco.Net.Socket.html#15012" title="Poco::Net::Socket::getReceiveTimeout()">getReceiveTimeout</a>, <a href="Poco.Net.Socket.html#15067" title="Poco::Net::Socket::getReuseAddress()">getReuseAddress</a>, <a href="Poco.Net.Socket.html#15070" title="Poco::Net::Socket::getReusePort()">getReusePort</a>, <a href="Poco.Net.Socket.html#15003" title="Poco::Net::Socket::getSendBufferSize()">getSendBufferSize</a>, <a href="Poco.Net.Socket.html#15009" title="Poco::Net::Socket::getSendTimeout()">getSendTimeout</a>, <a href="Poco.Net.Socket.html#15079" title="Poco::Net::Socket::impl()">impl</a>, <a href="Poco.Net.Socket.html#14981" title="Poco::Net::Socket::operator !=()">operator !=</a>, <a href="Poco.Net.Socket.html#14983" title="Poco::Net::Socket::operator <()">operator <</a>, <a href="Poco.Net.Socket.html#14985" title="Poco::Net::Socket::operator <=()">operator <=</a>, <a href="Poco.Net.Socket.html#14976" title="Poco::Net::Socket::operator =()">operator =</a>, <a href="Poco.Net.Socket.html#14979" title="Poco::Net::Socket::operator ==()">operator ==</a>, <a href="Poco.Net.Socket.html#14987" title="Poco::Net::Socket::operator >()">operator ></a>, <a href="Poco.Net.Socket.html#14989" title="Poco::Net::Socket::operator >=()">operator >=</a>, <a href="Poco.Net.Socket.html#15078" title="Poco::Net::Socket::peerAddress()">peerAddress</a>, <a href="Poco.Net.Socket.html#14997" title="Poco::Net::Socket::poll()">poll</a>, <a href="Poco.Net.Socket.html#14992" title="Poco::Net::Socket::select()">select</a>, <a href="Poco.Net.Socket.html#15074" title="Poco::Net::Socket::setBlocking()">setBlocking</a>, <a href="Poco.Net.Socket.html#15062" title="Poco::Net::Socket::setKeepAlive()">setKeepAlive</a>, <a href="Poco.Net.Socket.html#15053" title="Poco::Net::Socket::setLinger()">setLinger</a>, <a href="Poco.Net.Socket.html#15059" title="Poco::Net::Socket::setNoDelay()">setNoDelay</a>, <a href="Poco.Net.Socket.html#15071" title="Poco::Net::Socket::setOOBInline()">setOOBInline</a>, <a href="Poco.Net.Socket.html#15013" title="Poco::Net::Socket::setOption()">setOption</a>, <a href="Poco.Net.Socket.html#15004" title="Poco::Net::Socket::setReceiveBufferSize()">setReceiveBufferSize</a>, <a href="Poco.Net.Socket.html#15010" title="Poco::Net::Socket::setReceiveTimeout()">setReceiveTimeout</a>, <a href="Poco.Net.Socket.html#15065" title="Poco::Net::Socket::setReuseAddress()">setReuseAddress</a>, <a href="Poco.Net.Socket.html#15068" title="Poco::Net::Socket::setReusePort()">setReusePort</a>, <a href="Poco.Net.Socket.html#15001" title="Poco::Net::Socket::setSendBufferSize()">setSendBufferSize</a>, <a href="Poco.Net.Socket.html#15007" title="Poco::Net::Socket::setSendTimeout()">setSendTimeout</a>, <a href="Poco.Net.Socket.html#15084" title="Poco::Net::Socket::sockfd()">sockfd</a>, <a href="Poco.Net.Socket.html#15080" title="Poco::Net::Socket::supportsIPv4()">supportsIPv4</a>, <a href="Poco.Net.Socket.html#15081" title="Poco::Net::Socket::supportsIPv6()">supportsIPv6</a></p>
<h2>Types</h2>
<h3><a name="14972">SocketList</a></h3>
<p class="decl">typedef std::vector < <a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> > <a href="Poco.Net.Socket.html#14972" title="Poco::Net::Socket::SocketList">SocketList</a>;</p>
<div class="description">
<p></p>
</div>
<h2>Enumerations</h2>
<h3><a name="14968">SelectMode</a></h3>
<div class="description">
<p>The mode argument to <a href="Poco.Net.Socket.html#14997" title="Poco::Net::Socket::poll()">poll</a>() and <a href="Poco.Net.Socket.html#14992" title="Poco::Net::Socket::select()">select</a>(). </p>
</div>
<p class="decl"><a name="14969">SELECT_READ</a> = 1</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="14970">SELECT_WRITE</a> = 2</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="14971">SELECT_ERROR</a> = 4</p>
<div class="description">
<p></p>
</div>
<h2>Constructors</h2>
<h3><a name="14973">Socket</a></h3>
<p class="decl"><a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a>();</p>
<div class="description">
<p>Creates an uninitialized socket. </p>
</div>
<h3><a name="14974">Socket</a></h3>
<p class="decl"><a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a>(<br /> const <a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> & socket<br />);</p>
<div class="description">
<p>Copy constructor. </p>
<p>Attaches the <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a> from the other socket and increments the reference count of the <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a>. </p>
</div>
<h3><a name="15082">Socket</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a>(<br /> <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a> * pImpl<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> and attaches the given <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a>. The socket takes owership of the <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a>. </p>
</div>
<h2>Destructor</h2>
<h3><a name="14978">~Socket</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual ~<a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> and releases the <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="15077">address</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> address() const;</p>
<div class="description">
<p>Returns the IP address and port number of the socket. </p>
</div>
<h3><a name="15000">available</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int available() const;</p>
<div class="description">
<p>Returns the number of bytes available that can be read without causing the socket to block. </p>
</div>
<h3><a name="14991">close</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void close();</p>
<div class="description">
<p>Closes the socket. </p>
</div>
<h3><a name="15076">getBlocking</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool getBlocking() const;</p>
<div class="description">
<p>Returns the blocking mode of the socket. This method will only work if the blocking modes of the socket are changed via the setBlocking method! </p>
</div>
<h3><a name="15064">getKeepAlive</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool getKeepAlive() const;</p>
<div class="description">
<p>Returns the value of the SO_KEEPALIVE socket option. </p>
</div>
<h3><a name="15056">getLinger</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void getLinger(<br /> bool & on,<br /> int & seconds<br />) const;</p>
<div class="description">
<p>Returns the value of the SO_LINGER socket option. </p>
</div>
<h3><a name="15061">getNoDelay</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool getNoDelay() const;</p>
<div class="description">
<p>Returns the value of the TCP_NODELAY socket option. </p>
</div>
<h3><a name="15073">getOOBInline</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool getOOBInline() const;</p>
<div class="description">
<p>Returns the value of the SO_OOBINLINE socket option. </p>
</div>
<h3><a name="15033">getOption</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void getOption(<br /> int level,<br /> int option,<br /> int & value<br />) const;</p>
<div class="description">
<p>Returns the value of the socket option specified by level and option. </p>
</div>
<h3><a name="15037">getOption</a></h3>
<p class="decl">void getOption(<br /> int level,<br /> int option,<br /> unsigned & value<br />) const;</p>
<div class="description">
<p>Returns the value of the socket option specified by level and option. </p>
</div>
<h3><a name="15041">getOption</a></h3>
<p class="decl">void getOption(<br /> int level,<br /> int option,<br /> unsigned char & value<br />) const;</p>
<div class="description">
<p>Returns the value of the socket option specified by level and option. </p>
</div>
<h3><a name="15045">getOption</a></h3>
<p class="decl">void getOption(<br /> int level,<br /> int option,<br /> <a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> & value<br />) const;</p>
<div class="description">
<p>Returns the value of the socket option specified by level and option. </p>
</div>
<h3><a name="15049">getOption</a></h3>
<p class="decl">void getOption(<br /> int level,<br /> int option,<br /> <a href="Poco.Net.IPAddress.html" title="class Poco::Net::IPAddress">IPAddress</a> & value<br />) const;</p>
<div class="description">
<p>Returns the value of the socket option specified by level and option. </p>
</div>
<h3><a name="15006">getReceiveBufferSize</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int getReceiveBufferSize() const;</p>
<div class="description">
<p>Returns the size of the receive buffer. </p>
<p>The returned value may be different than the value previously set with <a href="Poco.Net.Socket.html#15004" title="Poco::Net::Socket::setReceiveBufferSize()">setReceiveBufferSize</a>(), as the system is free to adjust the value. </p>
</div>
<h3><a name="15012">getReceiveTimeout</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> getReceiveTimeout() const;</p>
<div class="description">
<p>Returns the receive timeout for the socket. </p>
<p>The returned timeout may be different than the timeout previously set with <a href="Poco.Net.Socket.html#15012" title="Poco::Net::Socket::getReceiveTimeout()">getReceiveTimeout</a>(), as the system is free to adjust the value. </p>
</div>
<h3><a name="15067">getReuseAddress</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool getReuseAddress() const;</p>
<div class="description">
<p>Returns the value of the SO_REUSEADDR socket option. </p>
</div>
<h3><a name="15070">getReusePort</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool getReusePort() const;</p>
<div class="description">
<p>Returns the value of the SO_REUSEPORT socket option. </p>
<p>Returns false if the socket implementation does not support SO_REUSEPORT. </p>
</div>
<h3><a name="15003">getSendBufferSize</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int getSendBufferSize() const;</p>
<div class="description">
<p>Returns the size of the send buffer. </p>
<p>The returned value may be different than the value previously set with <a href="Poco.Net.Socket.html#15001" title="Poco::Net::Socket::setSendBufferSize()">setSendBufferSize</a>(), as the system is free to adjust the value. </p>
</div>
<h3><a name="15009">getSendTimeout</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> getSendTimeout() const;</p>
<div class="description">
<p>Returns the send timeout for the socket. </p>
<p>The returned timeout may be different than the timeout previously set with <a href="Poco.Net.Socket.html#15007" title="Poco::Net::Socket::setSendTimeout()">setSendTimeout</a>(), as the system is free to adjust the value. </p>
</div>
<h3><a name="15079">impl</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a> * impl() const;</p>
<div class="description">
<p>Returns the <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a> for this socket. </p>
</div>
<h3><a name="14981">operator !=</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool operator != (<br /> const <a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> & socket<br />) const;</p>
<div class="description">
<p>Returns false if both sockets share the same <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a>, true otherwise. </p>
</div>
<h3><a name="14983">operator <</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool operator < (<br /> const <a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> & socket<br />) const;</p>
<div class="description">
<p>Compares the <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a> pointers. </p>
</div>
<h3><a name="14985">operator <=</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool operator <= (<br /> const <a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> & socket<br />) const;</p>
<div class="description">
<p>Compares the <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a> pointers. </p>
</div>
<h3><a name="14976">operator =</a></h3>
<p class="decl"><a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> & operator = (<br /> const <a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> & socket<br />);</p>
<div class="description">
<p>Assignment operator. </p>
<p>Releases the socket's <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a> and attaches the <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a> from the other socket and increments the reference count of the <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a>. </p>
</div>
<h3><a name="14979">operator ==</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool operator == (<br /> const <a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> & socket<br />) const;</p>
<div class="description">
<p>Returns true if both sockets share the same <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a>, false otherwise. </p>
</div>
<h3><a name="14987">operator ></a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool operator > (<br /> const <a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> & socket<br />) const;</p>
<div class="description">
<p>Compares the <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a> pointers. </p>
</div>
<h3><a name="14989">operator >=</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool operator >= (<br /> const <a href="Poco.Net.Socket.html" title="class Poco::Net::Socket">Socket</a> & socket<br />) const;</p>
<div class="description">
<p>Compares the <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a> pointers. </p>
</div>
<h3><a name="15078">peerAddress</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> peerAddress() const;</p>
<div class="description">
<p>Returns the IP address and port number of the peer socket. </p>
</div>
<h3><a name="14997">poll</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool poll(<br /> const <a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> & timeout,<br /> int mode<br />) const;</p>
<div class="description">
<p>Determines the status of the socket, using a call to <a href="Poco.Net.Socket.html#14992" title="Poco::Net::Socket::select()">select</a>(). </p>
<p>The mode argument is constructed by combining the values of the <a href="Poco.Net.Socket.html#14968" title="enum Poco::Net::Socket::SelectMode">SelectMode</a> enumeration. </p>
<p>Returns true if the next operation corresponding to mode will not block, false otherwise. </p>
</div>
<h3><a name="14992">select</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static int select(<br /> <a href="Poco.Net.Socket.html#14972" title="Poco::Net::Socket::SocketList">SocketList</a> & readList,<br /> <a href="Poco.Net.Socket.html#14972" title="Poco::Net::Socket::SocketList">SocketList</a> & writeList,<br /> <a href="Poco.Net.Socket.html#14972" title="Poco::Net::Socket::SocketList">SocketList</a> & exceptList,<br /> const <a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> & timeout<br />);</p>
<div class="description">
<p>Determines the status of one or more sockets, using a call to <a href="Poco.Net.Socket.html#14992" title="Poco::Net::Socket::select()">select</a>(). </p>
<p>ReadList contains the list of sockets which should be checked for readability. </p>
<p>WriteList contains the list of sockets which should be checked for writeability. </p>
<p>ExceptList contains a list of sockets which should be checked for a pending error. </p>
<p>Returns the number of sockets ready. </p>
<p>After return, </p>
<ul>
<li>readList contains those sockets ready for reading, </li>
<li>writeList contains those sockets ready for writing, </li>
<li>exceptList contains those sockets with a pending error. </li>
</ul>
<p>If the total number of sockets passed in readList, writeList and exceptList is zero, <a href="Poco.Net.Socket.html#14992" title="Poco::Net::Socket::select()">select</a>() will return immediately and the return value will be 0. </p>
<p>If one of the sockets passed to <a href="Poco.Net.Socket.html#14992" title="Poco::Net::Socket::select()">select</a>() is closed while <a href="Poco.Net.Socket.html#14992" title="Poco::Net::Socket::select()">select</a>() runs, select will return immediately. However, the closed socket will not be included in any list. In this case, the return value may be greater than the sum of all sockets in all list. </p>
</div>
<h3><a name="15074">setBlocking</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setBlocking(<br /> bool flag<br />);</p>
<div class="description">
<p>Sets the socket in blocking mode if flag is true, disables blocking mode if flag is false. </p>
</div>
<h3><a name="15062">setKeepAlive</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setKeepAlive(<br /> bool flag<br />);</p>
<div class="description">
<p>Sets the value of the SO_KEEPALIVE socket option. </p>
</div>
<h3><a name="15053">setLinger</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setLinger(<br /> bool on,<br /> int seconds<br />);</p>
<div class="description">
<p>Sets the value of the SO_LINGER socket option. </p>
</div>
<h3><a name="15059">setNoDelay</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setNoDelay(<br /> bool flag<br />);</p>
<div class="description">
<p>Sets the value of the TCP_NODELAY socket option. </p>
</div>
<h3><a name="15071">setOOBInline</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setOOBInline(<br /> bool flag<br />);</p>
<div class="description">
<p>Sets the value of the SO_OOBINLINE socket option. </p>
</div>
<h3><a name="15013">setOption</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setOption(<br /> int level,<br /> int option,<br /> int value<br />);</p>
<div class="description">
<p>Sets the socket option specified by level and option to the given integer value. </p>
</div>
<h3><a name="15017">setOption</a></h3>
<p class="decl">void setOption(<br /> int level,<br /> int option,<br /> unsigned value<br />);</p>
<div class="description">
<p>Sets the socket option specified by level and option to the given integer value. </p>
</div>
<h3><a name="15021">setOption</a></h3>
<p class="decl">void setOption(<br /> int level,<br /> int option,<br /> unsigned char value<br />);</p>
<div class="description">
<p>Sets the socket option specified by level and option to the given integer value. </p>
</div>
<h3><a name="15025">setOption</a></h3>
<p class="decl">void setOption(<br /> int level,<br /> int option,<br /> const <a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> & value<br />);</p>
<div class="description">
<p>Sets the socket option specified by level and option to the given time value. </p>
</div>
<h3><a name="15029">setOption</a></h3>
<p class="decl">void setOption(<br /> int level,<br /> int option,<br /> const <a href="Poco.Net.IPAddress.html" title="class Poco::Net::IPAddress">IPAddress</a> & value<br />);</p>
<div class="description">
<p>Sets the socket option specified by level and option to the given time value. </p>
</div>
<h3><a name="15004">setReceiveBufferSize</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setReceiveBufferSize(<br /> int size<br />);</p>
<div class="description">
<p>Sets the size of the receive buffer. </p>
</div>
<h3><a name="15010">setReceiveTimeout</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setReceiveTimeout(<br /> const <a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> & timeout<br />);</p>
<div class="description">
<p>Sets the send timeout for the socket. </p>
<p>On systems that do not support SO_RCVTIMEO, a workaround using <a href="Poco.Net.Socket.html#14997" title="Poco::Net::Socket::poll()">poll</a>() is provided. </p>
</div>
<h3><a name="15065">setReuseAddress</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setReuseAddress(<br /> bool flag<br />);</p>
<div class="description">
<p>Sets the value of the SO_REUSEADDR socket option. </p>
</div>
<h3><a name="15068">setReusePort</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setReusePort(<br /> bool flag<br />);</p>
<div class="description">
<p>Sets the value of the SO_REUSEPORT socket option. Does nothing if the socket implementation does not support SO_REUSEPORT. </p>
</div>
<h3><a name="15001">setSendBufferSize</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setSendBufferSize(<br /> int size<br />);</p>
<div class="description">
<p>Sets the size of the send buffer. </p>
</div>
<h3><a name="15007">setSendTimeout</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setSendTimeout(<br /> const <a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> & timeout<br />);</p>
<div class="description">
<p>Sets the send timeout for the socket. </p>
</div>
<h3><a name="15080">supportsIPv4</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static bool supportsIPv4();</p>
<div class="description">
<p>Returns true if the system supports IPv4. </p>
</div>
<h3><a name="15081">supportsIPv6</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static bool supportsIPv6();</p>
<div class="description">
<p>Returns true if the system supports IPv6. </p>
</div>
<h3><a name="15084">sockfd</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int sockfd() const;</p>
<div class="description">
<p>Returns the socket descriptor for this socket. </p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>
</div>
</body>
</html>
|