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 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446
|
<!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::SocketImpl</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 SocketImpl</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Net<br />
<b>Package:</b> Sockets<br />
<b>Header:</b> Poco/Net/SocketImpl.h</p>
<h2>Description</h2>
<div class="description">
<p>This class encapsulates the Berkeley sockets API. </p>
<p>Subclasses implement specific socket types like stream or datagram sockets. </p>
<p>You should not create any instances of this class. </p>
</div>
<h2>Inheritance</h2>
<p><b>Direct Base Classes: </b><a href="Poco.RefCountedObject.html" title="class Poco::RefCountedObject">Poco::RefCountedObject</a></p>
<p><b>All Base Classes: </b><a href="Poco.RefCountedObject.html" title="class Poco::RefCountedObject">Poco::RefCountedObject</a></p>
<p><b>Known Derived Classes: </b><a href="Poco.Net.DatagramSocketImpl.html" title="class Poco::Net::DatagramSocketImpl">DatagramSocketImpl</a>, <a href="Poco.Net.ICMPSocketImpl.html" title="class Poco::Net::ICMPSocketImpl">ICMPSocketImpl</a>, <a href="Poco.Net.RawSocketImpl.html" title="class Poco::Net::RawSocketImpl">RawSocketImpl</a>, <a href="Poco.Net.ServerSocketImpl.html" title="class Poco::Net::ServerSocketImpl">ServerSocketImpl</a>, <a href="Poco.Net.StreamSocketImpl.html" title="class Poco::Net::StreamSocketImpl">StreamSocketImpl</a>, <a href="Poco.Net.SecureStreamSocketImpl.html" title="class Poco::Net::SecureStreamSocketImpl">SecureStreamSocketImpl</a>, <a href="Poco.Net.SecureServerSocketImpl.html" title="class Poco::Net::SecureServerSocketImpl">SecureServerSocketImpl</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Net.SocketImpl.html#15187" title="Poco::Net::SocketImpl::acceptConnection()">acceptConnection</a>, <a href="Poco.Net.SocketImpl.html#15241" title="Poco::Net::SocketImpl::address()">address</a>, <a href="Poco.Net.SocketImpl.html#15225" title="Poco::Net::SocketImpl::available()">available</a>, <a href="Poco.Net.SocketImpl.html#15196" title="Poco::Net::SocketImpl::bind()">bind</a>, <a href="Poco.Net.SocketImpl.html#15201" title="Poco::Net::SocketImpl::close()">close</a>, <a href="Poco.Net.SocketImpl.html#15189" title="Poco::Net::SocketImpl::connect()">connect</a>, <a href="Poco.Net.SocketImpl.html#15194" title="Poco::Net::SocketImpl::connectNB()">connectNB</a>, <a href="Poco.Net.SocketImpl.html#15342" title="Poco::Net::SocketImpl::error()">error</a>, <a href="Poco.Net.SocketImpl.html#15319" title="Poco::Net::SocketImpl::getBlocking()">getBlocking</a>, <a href="Poco.Net.SocketImpl.html#15316" title="Poco::Net::SocketImpl::getBroadcast()">getBroadcast</a>, <a href="Poco.Net.SocketImpl.html#15304" title="Poco::Net::SocketImpl::getKeepAlive()">getKeepAlive</a>, <a href="Poco.Net.SocketImpl.html#15296" title="Poco::Net::SocketImpl::getLinger()">getLinger</a>, <a href="Poco.Net.SocketImpl.html#15301" title="Poco::Net::SocketImpl::getNoDelay()">getNoDelay</a>, <a href="Poco.Net.SocketImpl.html#15313" title="Poco::Net::SocketImpl::getOOBInline()">getOOBInline</a>, <a href="Poco.Net.SocketImpl.html#15268" title="Poco::Net::SocketImpl::getOption()">getOption</a>, <a href="Poco.Net.SocketImpl.html#15288" title="Poco::Net::SocketImpl::getRawOption()">getRawOption</a>, <a href="Poco.Net.SocketImpl.html#15234" title="Poco::Net::SocketImpl::getReceiveBufferSize()">getReceiveBufferSize</a>, <a href="Poco.Net.SocketImpl.html#15240" title="Poco::Net::SocketImpl::getReceiveTimeout()">getReceiveTimeout</a>, <a href="Poco.Net.SocketImpl.html#15307" title="Poco::Net::SocketImpl::getReuseAddress()">getReuseAddress</a>, <a href="Poco.Net.SocketImpl.html#15310" title="Poco::Net::SocketImpl::getReusePort()">getReusePort</a>, <a href="Poco.Net.SocketImpl.html#15231" title="Poco::Net::SocketImpl::getSendBufferSize()">getSendBufferSize</a>, <a href="Poco.Net.SocketImpl.html#15237" title="Poco::Net::SocketImpl::getSendTimeout()">getSendTimeout</a>, <a href="Poco.Net.SocketImpl.html#15333" title="Poco::Net::SocketImpl::init()">init</a>, <a href="Poco.Net.SocketImpl.html#15335" title="Poco::Net::SocketImpl::initSocket()">initSocket</a>, <a href="Poco.Net.SocketImpl.html#15328" title="Poco::Net::SocketImpl::initialized()">initialized</a>, <a href="Poco.Net.SocketImpl.html#15322" title="Poco::Net::SocketImpl::ioctl()">ioctl</a>, <a href="Poco.Net.SocketImpl.html#15341" title="Poco::Net::SocketImpl::lastError()">lastError</a>, <a href="Poco.Net.SocketImpl.html#15199" title="Poco::Net::SocketImpl::listen()">listen</a>, <a href="Poco.Net.SocketImpl.html#15242" title="Poco::Net::SocketImpl::peerAddress()">peerAddress</a>, <a href="Poco.Net.SocketImpl.html#15226" title="Poco::Net::SocketImpl::poll()">poll</a>, <a href="Poco.Net.SocketImpl.html#15209" title="Poco::Net::SocketImpl::receiveBytes()">receiveBytes</a>, <a href="Poco.Net.SocketImpl.html#15218" title="Poco::Net::SocketImpl::receiveFrom()">receiveFrom</a>, <a href="Poco.Net.SocketImpl.html#15339" title="Poco::Net::SocketImpl::reset()">reset</a>, <a href="Poco.Net.SocketImpl.html#15205" title="Poco::Net::SocketImpl::sendBytes()">sendBytes</a>, <a href="Poco.Net.SocketImpl.html#15213" title="Poco::Net::SocketImpl::sendTo()">sendTo</a>, <a href="Poco.Net.SocketImpl.html#15223" title="Poco::Net::SocketImpl::sendUrgent()">sendUrgent</a>, <a href="Poco.Net.SocketImpl.html#15317" title="Poco::Net::SocketImpl::setBlocking()">setBlocking</a>, <a href="Poco.Net.SocketImpl.html#15314" title="Poco::Net::SocketImpl::setBroadcast()">setBroadcast</a>, <a href="Poco.Net.SocketImpl.html#15302" title="Poco::Net::SocketImpl::setKeepAlive()">setKeepAlive</a>, <a href="Poco.Net.SocketImpl.html#15293" title="Poco::Net::SocketImpl::setLinger()">setLinger</a>, <a href="Poco.Net.SocketImpl.html#15299" title="Poco::Net::SocketImpl::setNoDelay()">setNoDelay</a>, <a href="Poco.Net.SocketImpl.html#15311" title="Poco::Net::SocketImpl::setOOBInline()">setOOBInline</a>, <a href="Poco.Net.SocketImpl.html#15243" title="Poco::Net::SocketImpl::setOption()">setOption</a>, <a href="Poco.Net.SocketImpl.html#15263" title="Poco::Net::SocketImpl::setRawOption()">setRawOption</a>, <a href="Poco.Net.SocketImpl.html#15232" title="Poco::Net::SocketImpl::setReceiveBufferSize()">setReceiveBufferSize</a>, <a href="Poco.Net.SocketImpl.html#15238" title="Poco::Net::SocketImpl::setReceiveTimeout()">setReceiveTimeout</a>, <a href="Poco.Net.SocketImpl.html#15305" title="Poco::Net::SocketImpl::setReuseAddress()">setReuseAddress</a>, <a href="Poco.Net.SocketImpl.html#15308" title="Poco::Net::SocketImpl::setReusePort()">setReusePort</a>, <a href="Poco.Net.SocketImpl.html#15229" title="Poco::Net::SocketImpl::setSendBufferSize()">setSendBufferSize</a>, <a href="Poco.Net.SocketImpl.html#15235" title="Poco::Net::SocketImpl::setSendTimeout()">setSendTimeout</a>, <a href="Poco.Net.SocketImpl.html#15204" title="Poco::Net::SocketImpl::shutdown()">shutdown</a>, <a href="Poco.Net.SocketImpl.html#15202" title="Poco::Net::SocketImpl::shutdownReceive()">shutdownReceive</a>, <a href="Poco.Net.SocketImpl.html#15203" title="Poco::Net::SocketImpl::shutdownSend()">shutdownSend</a>, <a href="Poco.Net.SocketImpl.html#15320" title="Poco::Net::SocketImpl::socketError()">socketError</a>, <a href="Poco.Net.SocketImpl.html#15321" title="Poco::Net::SocketImpl::sockfd()">sockfd</a></p>
<p><b>Inherited Functions: </b><a href="Poco.RefCountedObject.html#9659" title="Poco::RefCountedObject::duplicate()">duplicate</a>, <a href="Poco.RefCountedObject.html#9661" title="Poco::RefCountedObject::referenceCount()">referenceCount</a>, <a href="Poco.RefCountedObject.html#9660" title="Poco::RefCountedObject::release()">release</a></p>
<h2>Enumerations</h2>
<h3><a name="15183">SelectMode</a></h3>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="15184">SELECT_READ</a> = 1</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="15185">SELECT_WRITE</a> = 2</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="15186">SELECT_ERROR</a> = 4</p>
<div class="description">
<p></p>
</div>
<h2>Constructors</h2>
<h3><a name="15329">SocketImpl</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a>();</p>
<div class="description">
<p>Creates a <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a>. </p>
</div>
<h3><a name="15330">SocketImpl</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a>(<br /> int sockfd<br />);</p>
<div class="description">
<p>Creates a <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a> using the given native socket. </p>
</div>
<h2>Destructor</h2>
<h3><a name="15332">~SocketImpl</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual ~<a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Net.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a>. Closes the socket if it is still open. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="15187">acceptConnection</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.SocketImpl.html" title="class Poco::Net::SocketImpl">SocketImpl</a> * acceptConnection(<br /> <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> & clientAddr<br />);</p>
<div class="description">
<p>Get the next completed connection from the socket's completed connection queue. </p>
<p>If the queue is empty, waits until a connection request completes. </p>
<p>Returns a new TCP socket for the connection with the client. </p>
<p>The client socket's address is returned in clientAddr. </p>
</div>
<h3><a name="15241">address</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.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> address();</p>
<div class="description">
<p>Returns the IP address and port number of the socket. </p>
</div>
<h3><a name="15225">available</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual int available();</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="15196">bind</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void bind(<br /> const <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> & address,<br /> bool reuseAddress = false<br />);</p>
<div class="description">
<p>Bind a local address to the socket. </p>
<p>This is usually only done when establishing a server socket. TCP clients should not bind a socket to a specific address. </p>
<p>If reuseAddress is true, sets the SO_REUSEADDR socket option. </p>
</div>
<h3><a name="15201">close</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void close();</p>
<div class="description">
<p>Close the socket. </p>
</div>
<h3><a name="15189">connect</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void connect(<br /> const <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> & address<br />);</p>
<div class="description">
<p>Initializes the socket and establishes a connection to the TCP server at the given address. </p>
<p>Can also be used for UDP sockets. In this case, no connection is established. Instead, incoming and outgoing packets are restricted to the specified address. </p>
</div>
<h3><a name="15191">connect</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void connect(<br /> const <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> & address,<br /> const <a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> & timeout<br />);</p>
<div class="description">
<p>Initializes the socket, sets the socket timeout and establishes a connection to the TCP server at the given address. </p>
</div>
<h3><a name="15194">connectNB</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void connectNB(<br /> const <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> & address<br />);</p>
<div class="description">
<p>Initializes the socket and establishes a connection to the TCP server at the given address. Prior to opening the connection the socket is set to nonblocking mode. </p>
</div>
<h3><a name="15319">getBlocking</a> <img src="images/virtual.gif" alt="virtual" title="virtual" 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">virtual 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="15316">getBroadcast</a></h3>
<p class="decl">bool getBroadcast();</p>
<div class="description">
<p>Returns the value of the SO_BROADCAST socket option. </p>
</div>
<h3><a name="15304">getKeepAlive</a></h3>
<p class="decl">bool getKeepAlive();</p>
<div class="description">
<p>Returns the value of the SO_KEEPALIVE socket option. </p>
</div>
<h3><a name="15296">getLinger</a></h3>
<p class="decl">void getLinger(<br /> bool & on,<br /> int & seconds<br />);</p>
<div class="description">
<p>Returns the value of the SO_LINGER socket option. </p>
</div>
<h3><a name="15301">getNoDelay</a></h3>
<p class="decl">bool getNoDelay();</p>
<div class="description">
<p>Returns the value of the TCP_NODELAY socket option. </p>
</div>
<h3><a name="15313">getOOBInline</a></h3>
<p class="decl">bool getOOBInline();</p>
<div class="description">
<p>Returns the value of the SO_OOBINLINE socket option. </p>
</div>
<h3><a name="15268">getOption</a></h3>
<p class="decl">void getOption(<br /> int level,<br /> int option,<br /> int & value<br />);</p>
<div class="description">
<p>Returns the value of the socket option specified by level and option. </p>
</div>
<h3><a name="15272">getOption</a></h3>
<p class="decl">void getOption(<br /> int level,<br /> int option,<br /> unsigned & value<br />);</p>
<div class="description">
<p>Returns the value of the socket option specified by level and option. </p>
</div>
<h3><a name="15276">getOption</a></h3>
<p class="decl">void getOption(<br /> int level,<br /> int option,<br /> unsigned char & value<br />);</p>
<div class="description">
<p>Returns the value of the socket option specified by level and option. </p>
</div>
<h3><a name="15280">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 />);</p>
<div class="description">
<p>Returns the value of the socket option specified by level and option. </p>
</div>
<h3><a name="15284">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 />);</p>
<div class="description">
<p>Returns the value of the socket option specified by level and option. </p>
</div>
<h3><a name="15288">getRawOption</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void getRawOption(<br /> int level,<br /> int option,<br /> void * value,<br /> socklen_t & length<br />);</p>
<div class="description">
<p>Returns the value of the socket option specified by level and option. </p>
</div>
<h3><a name="15234">getReceiveBufferSize</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual int getReceiveBufferSize();</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.SocketImpl.html#15232" title="Poco::Net::SocketImpl::setReceiveBufferSize()">setReceiveBufferSize</a>(), as the system is free to adjust the value. </p>
</div>
<h3><a name="15240">getReceiveTimeout</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual <a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> getReceiveTimeout();</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.SocketImpl.html#15238" title="Poco::Net::SocketImpl::setReceiveTimeout()">setReceiveTimeout</a>(), as the system is free to adjust the value. </p>
</div>
<h3><a name="15307">getReuseAddress</a></h3>
<p class="decl">bool getReuseAddress();</p>
<div class="description">
<p>Returns the value of the SO_REUSEADDR socket option. </p>
</div>
<h3><a name="15310">getReusePort</a></h3>
<p class="decl">bool getReusePort();</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="15231">getSendBufferSize</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual int getSendBufferSize();</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.SocketImpl.html#15229" title="Poco::Net::SocketImpl::setSendBufferSize()">setSendBufferSize</a>(), as the system is free to adjust the value. </p>
</div>
<h3><a name="15237">getSendTimeout</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual <a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> getSendTimeout();</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.SocketImpl.html#15235" title="Poco::Net::SocketImpl::setSendTimeout()">setSendTimeout</a>(), as the system is free to adjust the value. </p>
</div>
<h3><a name="15328">initialized</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool initialized() const;</p>
<div class="description">
<p>Returns true if and only if the underlying socket is initialized. </p>
</div>
<h3><a name="15322">ioctl</a></h3>
<p class="decl">void ioctl(<br /> int request,<br /> int & arg<br />);</p>
<div class="description">
<p>A wrapper for the ioctl system call. </p>
</div>
<h3><a name="15325">ioctl</a></h3>
<p class="decl">void ioctl(<br /> int request,<br /> void * arg<br />);</p>
<div class="description">
<p>A wrapper for the ioctl system call. </p>
</div>
<h3><a name="15199">listen</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void listen(<br /> int backlog = 64<br />);</p>
<div class="description">
<p>Puts the socket into listening state. </p>
<p>The socket becomes a passive socket that can accept incoming connection requests. </p>
<p>The backlog argument specifies the maximum number of connections that can be queued for this socket. </p>
</div>
<h3><a name="15242">peerAddress</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.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> peerAddress();</p>
<div class="description">
<p>Returns the IP address and port number of the peer socket. </p>
</div>
<h3><a name="15226">poll</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual bool poll(<br /> const <a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> & timeout,<br /> int mode<br />);</p>
<div class="description">
<p>Determines the status of the socket, using a call to select(). </p>
<p>The mode argument is constructed by combining the values of the <a href="Poco.Net.SocketImpl.html#15183" title="enum Poco::Net::SocketImpl::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="15209">receiveBytes</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual int receiveBytes(<br /> void * buffer,<br /> int length,<br /> int flags = 0<br />);</p>
<div class="description">
<p>Receives data from the socket and stores it in buffer. Up to length bytes are received. </p>
<p>Returns the number of bytes received. </p>
<p>Certain socket implementations may also return a negative value denoting a certain condition. </p>
</div>
<h3><a name="15218">receiveFrom</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual int receiveFrom(<br /> void * buffer,<br /> int length,<br /> <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> & address,<br /> int flags = 0<br />);</p>
<div class="description">
<p>Receives data from the socket and stores it in buffer. Up to length bytes are received. Stores the address of the sender in address. </p>
<p>Returns the number of bytes received. </p>
</div>
<h3><a name="15205">sendBytes</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual int sendBytes(<br /> const void * buffer,<br /> int length,<br /> int flags = 0<br />);</p>
<div class="description">
<p>Sends the contents of the given buffer through the socket. </p>
<p>Returns the number of bytes sent, which may be less than the number of bytes specified. </p>
<p>Certain socket implementations may also return a negative value denoting a certain condition. </p>
</div>
<h3><a name="15213">sendTo</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual int sendTo(<br /> const void * buffer,<br /> int length,<br /> const <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> & address,<br /> int flags = 0<br />);</p>
<div class="description">
<p>Sends the contents of the given buffer through the socket to the given address. </p>
<p>Returns the number of bytes sent, which may be less than the number of bytes specified. </p>
</div>
<h3><a name="15223">sendUrgent</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void sendUrgent(<br /> unsigned char data<br />);</p>
<div class="description">
<p>Sends one byte of urgent data through the socket. </p>
<p>The data is sent with the MSG_OOB flag. </p>
<p>The preferred way for a socket to receive urgent data is by enabling the SO_OOBINLINE option. </p>
</div>
<h3><a name="15317">setBlocking</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual 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="15314">setBroadcast</a></h3>
<p class="decl">void setBroadcast(<br /> bool flag<br />);</p>
<div class="description">
<p>Sets the value of the SO_BROADCAST socket option. </p>
</div>
<h3><a name="15302">setKeepAlive</a></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="15293">setLinger</a></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="15299">setNoDelay</a></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="15311">setOOBInline</a></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="15243">setOption</a></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="15247">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="15251">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="15255">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="15259">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="15263">setRawOption</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void setRawOption(<br /> int level,<br /> int option,<br /> const void * value,<br /> socklen_t length<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="15232">setReceiveBufferSize</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void setReceiveBufferSize(<br /> int size<br />);</p>
<div class="description">
<p>Sets the size of the receive buffer. </p>
</div>
<h3><a name="15238">setReceiveTimeout</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual 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.SocketImpl.html#15226" title="Poco::Net::SocketImpl::poll()">poll</a>() is provided. </p>
</div>
<h3><a name="15305">setReuseAddress</a></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="15308">setReusePort</a></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="15229">setSendBufferSize</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void setSendBufferSize(<br /> int size<br />);</p>
<div class="description">
<p>Sets the size of the send buffer. </p>
</div>
<h3><a name="15235">setSendTimeout</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual 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="15204">shutdown</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void shutdown();</p>
<div class="description">
<p>Shuts down both the receiving and the sending part of the socket connection. </p>
</div>
<h3><a name="15202">shutdownReceive</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void shutdownReceive();</p>
<div class="description">
<p>Shuts down the receiving part of the socket connection. </p>
</div>
<h3><a name="15203">shutdownSend</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void shutdownSend();</p>
<div class="description">
<p>Shuts down the sending part of the socket connection. </p>
</div>
<h3><a name="15320">socketError</a></h3>
<p class="decl">int socketError();</p>
<div class="description">
<p>Returns the value of the SO_ERROR socket option. </p>
</div>
<h3><a name="15321">sockfd</a> <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 the underlying native socket. </p>
</div>
<h3><a name="15342">error</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void error();</p>
<div class="description">
<p>Throws an appropriate exception for the last error. </p>
</div>
<h3><a name="15343">error</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void error(<br /> const std::string & arg<br />);</p>
<div class="description">
<p>Throws an appropriate exception for the last error. </p>
</div>
<h3><a name="15345">error</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void error(<br /> int code<br />);</p>
<div class="description">
<p>Throws an appropriate exception for the given error code. </p>
</div>
<h3><a name="15347">error</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void error(<br /> int code,<br /> const std::string & arg<br />);</p>
<div class="description">
<p>Throws an appropriate exception for the given error code. </p>
</div>
<h3><a name="15333">init</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void init(<br /> int af<br />);</p>
<div class="description">
<p>Creates the underlying native socket. </p>
<p>Subclasses must implement this method so that it calls <a href="Poco.Net.SocketImpl.html#15335" title="Poco::Net::SocketImpl::initSocket()">initSocket</a>() with the appropriate arguments. </p>
<p>The default implementation creates a stream socket. </p>
</div>
<h3><a name="15335">initSocket</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void initSocket(<br /> int af,<br /> int type,<br /> int proto = 0<br />);</p>
<div class="description">
<p>Creates the underlying native socket. </p>
<p>The first argument, af, specifies the address family used by the socket, which should be either AF_INET or AF_INET6. </p>
<p>The second argument, type, specifies the type of the socket, which can be one of SOCK_STREAM, SOCK_DGRAM or SOCK_RAW. </p>
<p>The third argument, proto, is normally set to 0, except for raw sockets. </p>
</div>
<h3><a name="15341">lastError</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> <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 int lastError();</p>
<div class="description">
<p>Returns the last error code. </p>
</div>
<h3><a name="15339">reset</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void reset(<br /> int fd = - 1<br />);</p>
<div class="description">
<p>Allows subclasses to set the socket manually, if and only if no valid socket is set yet! </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>
|