/usr/share/doc/libjuce/apiref/classStreamingSocket.html is in libjuce-doc 4.3.0~repack-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | <!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"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JUCE: StreamingSocket Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">JUCE
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classStreamingSocket-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">StreamingSocket Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A wrapper for a streaming (TCP) socket.
<a href="classStreamingSocket.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a280e9f29da54da9a828c920d734cc580"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#a280e9f29da54da9a828c920d734cc580">StreamingSocket</a> ()</td></tr>
<tr class="memdesc:a280e9f29da54da9a828c920d734cc580"><td class="mdescLeft"> </td><td class="mdescRight">Creates an uninitialised socket. <a href="#a280e9f29da54da9a828c920d734cc580">More...</a><br /></td></tr>
<tr class="separator:a280e9f29da54da9a828c920d734cc580"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaed4b1879a7f212cf95382b418d03210"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#aaed4b1879a7f212cf95382b418d03210">~StreamingSocket</a> ()</td></tr>
<tr class="memdesc:aaed4b1879a7f212cf95382b418d03210"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#aaed4b1879a7f212cf95382b418d03210">More...</a><br /></td></tr>
<tr class="separator:aaed4b1879a7f212cf95382b418d03210"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa0788414f9c3f08d1c5adddf5481e17a"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#aa0788414f9c3f08d1c5adddf5481e17a">bindToPort</a> (int localPortNumber)</td></tr>
<tr class="memdesc:aa0788414f9c3f08d1c5adddf5481e17a"><td class="mdescLeft"> </td><td class="mdescRight">Binds the socket to the specified local port. <a href="#aa0788414f9c3f08d1c5adddf5481e17a">More...</a><br /></td></tr>
<tr class="separator:aa0788414f9c3f08d1c5adddf5481e17a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a65448313c7cfb7384729eeda7de69ef6"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#a65448313c7cfb7384729eeda7de69ef6">bindToPort</a> (int localPortNumber, const <a class="el" href="classString.html">String</a> &localAddress)</td></tr>
<tr class="memdesc:a65448313c7cfb7384729eeda7de69ef6"><td class="mdescLeft"> </td><td class="mdescRight">Binds the socket to the specified local port and local address. <a href="#a65448313c7cfb7384729eeda7de69ef6">More...</a><br /></td></tr>
<tr class="separator:a65448313c7cfb7384729eeda7de69ef6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad4138f041b6875937b1910a2be0f1b5f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#ad4138f041b6875937b1910a2be0f1b5f">getBoundPort</a> () const noexcept</td></tr>
<tr class="memdesc:ad4138f041b6875937b1910a2be0f1b5f"><td class="mdescLeft"> </td><td class="mdescRight">Returns the local port number to which this socket is currently bound. <a href="#ad4138f041b6875937b1910a2be0f1b5f">More...</a><br /></td></tr>
<tr class="separator:ad4138f041b6875937b1910a2be0f1b5f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a42934b3f0d68f46f29cc7bb5d1067c33"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#a42934b3f0d68f46f29cc7bb5d1067c33">connect</a> (const <a class="el" href="classString.html">String</a> &remoteHostname, int remotePortNumber, int timeOutMillisecs=3000)</td></tr>
<tr class="memdesc:a42934b3f0d68f46f29cc7bb5d1067c33"><td class="mdescLeft"> </td><td class="mdescRight">Tries to connect the socket to hostname:port. <a href="#a42934b3f0d68f46f29cc7bb5d1067c33">More...</a><br /></td></tr>
<tr class="separator:a42934b3f0d68f46f29cc7bb5d1067c33"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a22d32e5442ccae9033278729aaa3e075"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#a22d32e5442ccae9033278729aaa3e075">isConnected</a> () const noexcept</td></tr>
<tr class="memdesc:a22d32e5442ccae9033278729aaa3e075"><td class="mdescLeft"> </td><td class="mdescRight">True if the socket is currently connected. <a href="#a22d32e5442ccae9033278729aaa3e075">More...</a><br /></td></tr>
<tr class="separator:a22d32e5442ccae9033278729aaa3e075"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a59ad8b03c9b5ef8572f9b159d3a411d9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#a59ad8b03c9b5ef8572f9b159d3a411d9">close</a> ()</td></tr>
<tr class="memdesc:a59ad8b03c9b5ef8572f9b159d3a411d9"><td class="mdescLeft"> </td><td class="mdescRight">Closes the connection. <a href="#a59ad8b03c9b5ef8572f9b159d3a411d9">More...</a><br /></td></tr>
<tr class="separator:a59ad8b03c9b5ef8572f9b159d3a411d9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1f0908b06027d58c1070f5bf1d700959"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classString.html">String</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#a1f0908b06027d58c1070f5bf1d700959">getHostName</a> () const noexcept</td></tr>
<tr class="memdesc:a1f0908b06027d58c1070f5bf1d700959"><td class="mdescLeft"> </td><td class="mdescRight">Returns the name of the currently connected host. <a href="#a1f0908b06027d58c1070f5bf1d700959">More...</a><br /></td></tr>
<tr class="separator:a1f0908b06027d58c1070f5bf1d700959"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a27a413769755ff853ab63a6f27338cce"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#a27a413769755ff853ab63a6f27338cce">getPort</a> () const noexcept</td></tr>
<tr class="memdesc:a27a413769755ff853ab63a6f27338cce"><td class="mdescLeft"> </td><td class="mdescRight">Returns the port number that's currently open. <a href="#a27a413769755ff853ab63a6f27338cce">More...</a><br /></td></tr>
<tr class="separator:a27a413769755ff853ab63a6f27338cce"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a47a3da922f5a1bc2d111caa38bd23d2e"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#a47a3da922f5a1bc2d111caa38bd23d2e">isLocal</a> () const noexcept</td></tr>
<tr class="memdesc:a47a3da922f5a1bc2d111caa38bd23d2e"><td class="mdescLeft"> </td><td class="mdescRight">True if the socket is connected to this machine rather than over the network. <a href="#a47a3da922f5a1bc2d111caa38bd23d2e">More...</a><br /></td></tr>
<tr class="separator:a47a3da922f5a1bc2d111caa38bd23d2e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4809d51655d78f65ee476629b7f1c260"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#a4809d51655d78f65ee476629b7f1c260">getRawSocketHandle</a> () const noexcept</td></tr>
<tr class="memdesc:a4809d51655d78f65ee476629b7f1c260"><td class="mdescLeft"> </td><td class="mdescRight">Returns the OS's socket handle that's currently open. <a href="#a4809d51655d78f65ee476629b7f1c260">More...</a><br /></td></tr>
<tr class="separator:a4809d51655d78f65ee476629b7f1c260"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a28790c3be16725f1b804128ce83f017d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#a28790c3be16725f1b804128ce83f017d">waitUntilReady</a> (bool readyForReading, int timeoutMsecs) const</td></tr>
<tr class="memdesc:a28790c3be16725f1b804128ce83f017d"><td class="mdescLeft"> </td><td class="mdescRight">Waits until the socket is ready for reading or writing. <a href="#a28790c3be16725f1b804128ce83f017d">More...</a><br /></td></tr>
<tr class="separator:a28790c3be16725f1b804128ce83f017d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac048823c044a47600f7f1036c730b934"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#ac048823c044a47600f7f1036c730b934">read</a> (void *destBuffer, int maxBytesToRead, bool blockUntilSpecifiedAmountHasArrived)</td></tr>
<tr class="memdesc:ac048823c044a47600f7f1036c730b934"><td class="mdescLeft"> </td><td class="mdescRight">Reads bytes from the socket. <a href="#ac048823c044a47600f7f1036c730b934">More...</a><br /></td></tr>
<tr class="separator:ac048823c044a47600f7f1036c730b934"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a90721593b92401ecd20aae2c68d3d446"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#a90721593b92401ecd20aae2c68d3d446">write</a> (const void *sourceBuffer, int numBytesToWrite)</td></tr>
<tr class="memdesc:a90721593b92401ecd20aae2c68d3d446"><td class="mdescLeft"> </td><td class="mdescRight">Writes bytes to the socket from a buffer. <a href="#a90721593b92401ecd20aae2c68d3d446">More...</a><br /></td></tr>
<tr class="separator:a90721593b92401ecd20aae2c68d3d446"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abd27eafb1f4e3a1bae915e2eb72f41e6"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#abd27eafb1f4e3a1bae915e2eb72f41e6">createListener</a> (int portNumber, const <a class="el" href="classString.html">String</a> &localHostName=<a class="el" href="classString.html">String</a>())</td></tr>
<tr class="memdesc:abd27eafb1f4e3a1bae915e2eb72f41e6"><td class="mdescLeft"> </td><td class="mdescRight">Puts this socket into "listener" mode. <a href="#abd27eafb1f4e3a1bae915e2eb72f41e6">More...</a><br /></td></tr>
<tr class="separator:abd27eafb1f4e3a1bae915e2eb72f41e6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3114fb89d7a07bfeacd04e3c207620f9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classStreamingSocket.html">StreamingSocket</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classStreamingSocket.html#a3114fb89d7a07bfeacd04e3c207620f9">waitForNextConnection</a> () const</td></tr>
<tr class="memdesc:a3114fb89d7a07bfeacd04e3c207620f9"><td class="mdescLeft"> </td><td class="mdescRight">When in "listener" mode, this waits for a connection and spawns it as a new socket. <a href="#a3114fb89d7a07bfeacd04e3c207620f9">More...</a><br /></td></tr>
<tr class="separator:a3114fb89d7a07bfeacd04e3c207620f9"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A wrapper for a streaming (TCP) socket. </p>
<p>This allows low-level use of sockets; for an easier-to-use messaging layer on top of sockets, you could also try the <a class="el" href="classInterprocessConnection.html" title="Manages a simple two-way messaging connection to another process, using either a socket or a named pi...">InterprocessConnection</a> class.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classDatagramSocket.html" title="A wrapper for a datagram (UDP) socket. ">DatagramSocket</a>, <a class="el" href="classInterprocessConnection.html" title="Manages a simple two-way messaging connection to another process, using either a socket or a named pi...">InterprocessConnection</a>, <a class="el" href="classInterprocessConnectionServer.html" title="An object that waits for client sockets to connect to a port on this host, and creates InterprocessCo...">InterprocessConnectionServer</a> </dd></dl>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="a280e9f29da54da9a828c920d734cc580"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a280e9f29da54da9a828c920d734cc580">§ </a></span>StreamingSocket()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">StreamingSocket::StreamingSocket </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates an uninitialised socket. </p>
<p>To connect it, use the <a class="el" href="classStreamingSocket.html#a42934b3f0d68f46f29cc7bb5d1067c33" title="Tries to connect the socket to hostname:port. ">connect()</a> method, after which you can <a class="el" href="classStreamingSocket.html#ac048823c044a47600f7f1036c730b934" title="Reads bytes from the socket. ">read()</a> or <a class="el" href="classStreamingSocket.html#a90721593b92401ecd20aae2c68d3d446" title="Writes bytes to the socket from a buffer. ">write()</a> to it.</p>
<p>To wait for other sockets to connect to this one, the <a class="el" href="classStreamingSocket.html#abd27eafb1f4e3a1bae915e2eb72f41e6" title="Puts this socket into "listener" mode. ">createListener()</a> method enters "listener" mode, and can be used to spawn new sockets for each connection that comes along. </p>
</div>
</div>
<a id="aaed4b1879a7f212cf95382b418d03210"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaed4b1879a7f212cf95382b418d03210">§ </a></span>~StreamingSocket()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">StreamingSocket::~StreamingSocket </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aa0788414f9c3f08d1c5adddf5481e17a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0788414f9c3f08d1c5adddf5481e17a">§ </a></span>bindToPort() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool StreamingSocket::bindToPort </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>localPortNumber</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Binds the socket to the specified local port. </p>
<dl class="section return"><dt>Returns</dt><dd>true on success; false may indicate that another socket is already bound on the same port </dd></dl>
</div>
</div>
<a id="a65448313c7cfb7384729eeda7de69ef6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a65448313c7cfb7384729eeda7de69ef6">§ </a></span>bindToPort() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool StreamingSocket::bindToPort </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>localPortNumber</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>localAddress</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Binds the socket to the specified local port and local address. </p>
<p>If localAddress is not an empty string then the socket will be bound to localAddress as well. This is useful if you would like to bind your socket to a specific network adapter. Note that localAddress must be an IP address assigned to one of your network address otherwise this function will fail. </p><dl class="section return"><dt>Returns</dt><dd>true on success; false may indicate that another socket is already bound on the same port </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classStreamingSocket.html#aa0788414f9c3f08d1c5adddf5481e17a" title="Binds the socket to the specified local port. ">bindToPort(int localPortNumber)</a>, <a class="el" href="classIPAddress.html#a2424aa8366d381e689ddb22e716f8960" title="Populates a list of all the IP addresses that this machine is using. ">IPAddress::findAllAddresses</a> </dd></dl>
</div>
</div>
<a id="ad4138f041b6875937b1910a2be0f1b5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad4138f041b6875937b1910a2be0f1b5f">§ </a></span>getBoundPort()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int StreamingSocket::getBoundPort </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the local port number to which this socket is currently bound. </p>
<p>This is useful if you need to know to which port the OS has actually bound your socket when calling the constructor or bindToPort with zero as the localPortNumber argument. Returns -1 if the function fails. </p>
</div>
</div>
<a id="a42934b3f0d68f46f29cc7bb5d1067c33"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a42934b3f0d68f46f29cc7bb5d1067c33">§ </a></span>connect()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool StreamingSocket::connect </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>remoteHostname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>remotePortNumber</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>timeOutMillisecs</em> = <code>3000</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Tries to connect the socket to hostname:port. </p>
<p>If timeOutMillisecs is 0, then this method will block until the operating system rejects the connection (which could take a long time).</p>
<dl class="section return"><dt>Returns</dt><dd>true if it succeeds. </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classStreamingSocket.html#a22d32e5442ccae9033278729aaa3e075" title="True if the socket is currently connected. ">isConnected</a> </dd></dl>
</div>
</div>
<a id="a22d32e5442ccae9033278729aaa3e075"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a22d32e5442ccae9033278729aaa3e075">§ </a></span>isConnected()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool StreamingSocket::isConnected </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>True if the socket is currently connected. </p>
</div>
</div>
<a id="a59ad8b03c9b5ef8572f9b159d3a411d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59ad8b03c9b5ef8572f9b159d3a411d9">§ </a></span>close()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void StreamingSocket::close </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Closes the connection. </p>
</div>
</div>
<a id="a1f0908b06027d58c1070f5bf1d700959"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f0908b06027d58c1070f5bf1d700959">§ </a></span>getHostName()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classString.html">String</a>& StreamingSocket::getHostName </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the name of the currently connected host. </p>
</div>
</div>
<a id="a27a413769755ff853ab63a6f27338cce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27a413769755ff853ab63a6f27338cce">§ </a></span>getPort()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int StreamingSocket::getPort </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the port number that's currently open. </p>
</div>
</div>
<a id="a47a3da922f5a1bc2d111caa38bd23d2e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a47a3da922f5a1bc2d111caa38bd23d2e">§ </a></span>isLocal()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool StreamingSocket::isLocal </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>True if the socket is connected to this machine rather than over the network. </p>
</div>
</div>
<a id="a4809d51655d78f65ee476629b7f1c260"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4809d51655d78f65ee476629b7f1c260">§ </a></span>getRawSocketHandle()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int StreamingSocket::getRawSocketHandle </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the OS's socket handle that's currently open. </p>
<p>References <a class="el" href="juce__PlatformDefs_8h.html#a851b02724a8158a7f746c66b5758b3dd">JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR</a>.</p>
</div>
</div>
<a id="a28790c3be16725f1b804128ce83f017d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a28790c3be16725f1b804128ce83f017d">§ </a></span>waitUntilReady()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int StreamingSocket::waitUntilReady </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"><em>readyForReading</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>timeoutMsecs</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Waits until the socket is ready for reading or writing. </p>
<p>If readyForReading is true, it will wait until the socket is ready for reading; if false, it will wait until it's ready for writing.</p>
<p>If the timeout is < 0, it will wait forever, or else will give up after the specified time.</p>
<p>If the socket is ready on return, this returns 1. If it times-out before the socket becomes ready, it returns 0. If an error occurs, it returns -1. </p>
</div>
</div>
<a id="ac048823c044a47600f7f1036c730b934"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac048823c044a47600f7f1036c730b934">§ </a></span>read()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int StreamingSocket::read </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>destBuffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>maxBytesToRead</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>blockUntilSpecifiedAmountHasArrived</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reads bytes from the socket. </p>
<p>If blockUntilSpecifiedAmountHasArrived is true, the method will block until maxBytesToRead bytes have been read, (or until an error occurs). If this flag is false, the method will return as much data as is currently available without blocking.</p>
<dl class="section return"><dt>Returns</dt><dd>the number of bytes read, or -1 if there was an error. </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classStreamingSocket.html#a28790c3be16725f1b804128ce83f017d" title="Waits until the socket is ready for reading or writing. ">waitUntilReady</a> </dd></dl>
</div>
</div>
<a id="a90721593b92401ecd20aae2c68d3d446"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90721593b92401ecd20aae2c68d3d446">§ </a></span>write()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int StreamingSocket::write </td>
<td>(</td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>sourceBuffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>numBytesToWrite</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Writes bytes to the socket from a buffer. </p>
<p>Note that this method will block unless you have checked the socket is ready for writing before calling it (see the <a class="el" href="classStreamingSocket.html#a28790c3be16725f1b804128ce83f017d" title="Waits until the socket is ready for reading or writing. ">waitUntilReady()</a> method).</p>
<dl class="section return"><dt>Returns</dt><dd>the number of bytes written, or -1 if there was an error. </dd></dl>
</div>
</div>
<a id="abd27eafb1f4e3a1bae915e2eb72f41e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abd27eafb1f4e3a1bae915e2eb72f41e6">§ </a></span>createListener()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool StreamingSocket::createListener </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>portNumber</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>localHostName</em> = <code><a class="el" href="classString.html">String</a>()</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Puts this socket into "listener" mode. </p>
<p>When in this mode, your thread can call <a class="el" href="classStreamingSocket.html#a3114fb89d7a07bfeacd04e3c207620f9" title="When in "listener" mode, this waits for a connection and spawns it as a new socket. ">waitForNextConnection()</a> repeatedly, which will spawn new sockets for each new connection, so that these can be handled in parallel by other threads.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">portNumber</td><td>the port number to listen on </td></tr>
<tr><td class="paramname">localHostName</td><td>the interface address to listen on - pass an empty string to listen on all addresses </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if it manages to open the socket successfully.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classStreamingSocket.html#a3114fb89d7a07bfeacd04e3c207620f9" title="When in "listener" mode, this waits for a connection and spawns it as a new socket. ">waitForNextConnection</a> </dd></dl>
</div>
</div>
<a id="a3114fb89d7a07bfeacd04e3c207620f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3114fb89d7a07bfeacd04e3c207620f9">§ </a></span>waitForNextConnection()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classStreamingSocket.html">StreamingSocket</a>* StreamingSocket::waitForNextConnection </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>When in "listener" mode, this waits for a connection and spawns it as a new socket. </p>
<p>The object that gets returned will be owned by the caller.</p>
<p>This method can only be called after using <a class="el" href="classStreamingSocket.html#abd27eafb1f4e3a1bae915e2eb72f41e6" title="Puts this socket into "listener" mode. ">createListener()</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classStreamingSocket.html#abd27eafb1f4e3a1bae915e2eb72f41e6" title="Puts this socket into "listener" mode. ">createListener</a> </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="juce__Socket_8h.html">juce_Socket.h</a></li>
</ul>
</div><!-- contents -->
<hr class="footer"/>
<address class="footer"><small>All content © ROLI Ltd.</small></address><br/>
</body>
</html>
|