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 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>wxWidgets: wxSocketBase 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="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="page_container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
<tbody>
<tr>
<td id="projectlogo">
<a href="http://www.wxwidgets.org/" target="_new">
<img alt="wxWidgets" src="logo.png"/>
</a>
</td>
<td style="padding-left: 0.5em; text-align: right;">
<span id="projectnumber">Version: 3.0.2</span>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Categories</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="classwx_socket_base-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">wxSocketBase Class Reference<div class="ingroups"><a class="el" href="group__group__class__net.html">Networking</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <wx/socket.h></code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for wxSocketBase:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classwx_socket_base__inherit__graph.png" border="0" usemap="#wx_socket_base_inherit__map" alt="Inheritance graph"/></div>
<map name="wx_socket_base_inherit__map" id="wx_socket_base_inherit__map">
<area shape="rect" id="node5" href="classwx_datagram_socket.html" title="wxDatagramSocket" alt="" coords="5,161,139,189"/><area shape="rect" id="node7" href="classwx_socket_client.html" title="wxSocketClient" alt="" coords="163,161,272,189"/><area shape="rect" id="node15" href="classwx_socket_server.html" title="wxSocketServer" alt="" coords="296,161,411,189"/><area shape="rect" id="node2" href="classwx_object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="180,6,255,34"/><area shape="rect" id="node9" href="classwx_protocol.html" title="Represents a protocol for use with wxURL." alt="" coords="175,238,260,266"/><area shape="rect" id="node11" href="classwx_f_t_p.html" title="wxFTP can be used to establish a connection to an FTP server and perform all the usual operations..." alt="" coords="143,315,204,343"/><area shape="rect" id="node13" href="classwx_h_t_t_p.html" title="wxHTTP can be used to establish a connection to an HTTP server." alt="" coords="228,315,297,343"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classwx_socket_base.html" title="wxSocketBase is the base class for all socket-related objects, and it defines all basic IO functional...">wxSocketBase</a> is the base class for all socket-related objects, and it defines all basic IO functionality. </p>
<dl class="section note"><dt>Note</dt><dd>When using wxSocket from multiple threads, even implicitly (e.g. by using <a class="el" href="classwx_f_t_p.html" title="wxFTP can be used to establish a connection to an FTP server and perform all the usual operations...">wxFTP</a> or <a class="el" href="classwx_h_t_t_p.html" title="wxHTTP can be used to establish a connection to an HTTP server.">wxHTTP</a> in another thread) you must initialize the sockets from the main thread by calling <a class="el" href="classwx_socket_base.html#a4c4c4cc8e1fcd824ef621b0f3d17b29f" title="Perform the initialization needed in order to use the sockets.">Initialize()</a> before creating the other ones.</dd></dl>
<h2>Events emitted by this class</h2>
<p>The following event handler macros redirect the events to member function handlers '<b>func</b>' with prototypes like: </p>
<div class="eventHandler"><span>void handlerFuncName(<a class="el" href="classwx_socket_event.html" title="This event class contains information about socket events.">wxSocketEvent</a>& event)</span></div><p>Event macros for events emitted by this class:</p>
<div> </div><ul>
<li><span class="event">EVT_SOCKET(id, func)</span>:<div class="eventDesc"> Process a <code>wxEVT_SOCKET</code> event. See <a class="el" href="socket_8h.html#wxSocketEventFlags">wxSocketEventFlags</a> and <a class="el" href="socket_8h.html#wxSocketFlags">wxSocketFlags</a> for more info. </div></li>
</ul>
<h2></h2>
<div><span class="lib">Library:</span>  <span class="lib_text"><a class="el" href="page_libs.html#page_libs_wxnet">wxNet</a></span></div><div><span class="category">Category:</span>  <span class="category_text"><a class="el" href="group__group__class__net.html">Networking</a></span></div><dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_event.html" title="This event class contains information about socket events.">wxSocketEvent</a>, <a class="el" href="classwx_socket_client.html">wxSocketClient</a>, <a class="el" href="classwx_socket_server.html">wxSocketServer</a>, <a class="el" href="page_samples.html#page_samples_sockets">Sockets Sample</a>, <a class="el" href="socket_8h.html#wxSocketFlags">wxSocketFlags</a>, <a class="el" href="socket_8h.html#a2ec8996eecae7da1c5fa77c88a45a353">wxSocketEventFlags</a>, <a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6" title="wxSocket error return values.">wxSocketError</a> </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
Construction and Destruction</h2></td></tr>
<tr class="memitem:a3bf32997db6732a5b053d8d52b1173f0"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a3bf32997db6732a5b053d8d52b1173f0">wxSocketBase</a> ()</td></tr>
<tr class="memdesc:a3bf32997db6732a5b053d8d52b1173f0"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#a3bf32997db6732a5b053d8d52b1173f0"></a><br/></td></tr>
<tr class="separator:a3bf32997db6732a5b053d8d52b1173f0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a636e72242dd5550e84456c277ca31222"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a636e72242dd5550e84456c277ca31222">~wxSocketBase</a> ()</td></tr>
<tr class="memdesc:a636e72242dd5550e84456c277ca31222"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a636e72242dd5550e84456c277ca31222"></a><br/></td></tr>
<tr class="separator:a636e72242dd5550e84456c277ca31222"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab0b0926cfdfdd00b8b5c5f7f57cea861"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#ab0b0926cfdfdd00b8b5c5f7f57cea861">Destroy</a> ()</td></tr>
<tr class="memdesc:ab0b0926cfdfdd00b8b5c5f7f57cea861"><td class="mdescLeft"> </td><td class="mdescRight">Destroys the socket safely. <a href="#ab0b0926cfdfdd00b8b5c5f7f57cea861"></a><br/></td></tr>
<tr class="separator:ab0b0926cfdfdd00b8b5c5f7f57cea861"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4c4c4cc8e1fcd824ef621b0f3d17b29f"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a4c4c4cc8e1fcd824ef621b0f3d17b29f">Initialize</a> ()</td></tr>
<tr class="memdesc:a4c4c4cc8e1fcd824ef621b0f3d17b29f"><td class="mdescLeft"> </td><td class="mdescRight">Perform the initialization needed in order to use the sockets. <a href="#a4c4c4cc8e1fcd824ef621b0f3d17b29f"></a><br/></td></tr>
<tr class="separator:a4c4c4cc8e1fcd824ef621b0f3d17b29f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acfa7398ce7fac6e8db20caeb3a09b10e"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#acfa7398ce7fac6e8db20caeb3a09b10e">Shutdown</a> ()</td></tr>
<tr class="memdesc:acfa7398ce7fac6e8db20caeb3a09b10e"><td class="mdescLeft"> </td><td class="mdescRight">Shut down the sockets. <a href="#acfa7398ce7fac6e8db20caeb3a09b10e"></a><br/></td></tr>
<tr class="separator:acfa7398ce7fac6e8db20caeb3a09b10e"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Socket State</div></td></tr>
<tr class="memitem:a1a70bf5e24ccf3a6171ba07c06f8dac9"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9">Error</a> () const </td></tr>
<tr class="memdesc:a1a70bf5e24ccf3a6171ba07c06f8dac9"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if an error occurred in the last IO operation. <a href="#a1a70bf5e24ccf3a6171ba07c06f8dac9"></a><br/></td></tr>
<tr class="separator:a1a70bf5e24ccf3a6171ba07c06f8dac9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1751b32af0172a30f544068100ba90d2"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a1751b32af0172a30f544068100ba90d2">GetLocal</a> (<a class="el" href="classwx_sock_address.html">wxSockAddress</a> &addr) const </td></tr>
<tr class="memdesc:a1751b32af0172a30f544068100ba90d2"><td class="mdescLeft"> </td><td class="mdescRight">Return the local address of the socket. <a href="#a1751b32af0172a30f544068100ba90d2"></a><br/></td></tr>
<tr class="separator:a1751b32af0172a30f544068100ba90d2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aae825b5309067c212640189d6ad7e993"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#aae825b5309067c212640189d6ad7e993">GetPeer</a> (<a class="el" href="classwx_sock_address.html">wxSockAddress</a> &addr) const </td></tr>
<tr class="memdesc:aae825b5309067c212640189d6ad7e993"><td class="mdescLeft"> </td><td class="mdescRight">Return the peer address field of the socket. <a href="#aae825b5309067c212640189d6ad7e993"></a><br/></td></tr>
<tr class="separator:aae825b5309067c212640189d6ad7e993"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adb940bb2853901b4ea0b2840964f8e5b"><td class="memItemLeft" align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#adb940bb2853901b4ea0b2840964f8e5b">GetTimeout</a> () const </td></tr>
<tr class="memdesc:adb940bb2853901b4ea0b2840964f8e5b"><td class="mdescLeft"> </td><td class="mdescRight">Return the socket timeout in seconds. <a href="#adb940bb2853901b4ea0b2840964f8e5b"></a><br/></td></tr>
<tr class="separator:adb940bb2853901b4ea0b2840964f8e5b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2d171f3eac0dbc9211f0032188d381ac"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a2d171f3eac0dbc9211f0032188d381ac">IsConnected</a> () const </td></tr>
<tr class="memdesc:a2d171f3eac0dbc9211f0032188d381ac"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if the socket is connected. <a href="#a2d171f3eac0dbc9211f0032188d381ac"></a><br/></td></tr>
<tr class="separator:a2d171f3eac0dbc9211f0032188d381ac"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6703a3dd7c15fcb2eff7c7baf0b886f5"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a6703a3dd7c15fcb2eff7c7baf0b886f5">IsData</a> ()</td></tr>
<tr class="memdesc:a6703a3dd7c15fcb2eff7c7baf0b886f5"><td class="mdescLeft"> </td><td class="mdescRight">Check if the socket can be currently read or written. <a href="#a6703a3dd7c15fcb2eff7c7baf0b886f5"></a><br/></td></tr>
<tr class="separator:a6703a3dd7c15fcb2eff7c7baf0b886f5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac5118b15195664969b7d914a045936f6"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#ac5118b15195664969b7d914a045936f6">IsDisconnected</a> () const </td></tr>
<tr class="memdesc:ac5118b15195664969b7d914a045936f6"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if the socket is not connected. <a href="#ac5118b15195664969b7d914a045936f6"></a><br/></td></tr>
<tr class="separator:ac5118b15195664969b7d914a045936f6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a86799181fb499a72a42651704a3bbda3"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a86799181fb499a72a42651704a3bbda3">IsOk</a> () const </td></tr>
<tr class="memdesc:a86799181fb499a72a42651704a3bbda3"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if the socket is initialized and ready and <span class="literal">false</span> in other cases. <a href="#a86799181fb499a72a42651704a3bbda3"></a><br/></td></tr>
<tr class="separator:a86799181fb499a72a42651704a3bbda3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5b0cfbb970153b563c7134c1e8ba8319"><td class="memItemLeft" align="right" valign="top"><a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a5b0cfbb970153b563c7134c1e8ba8319">LastCount</a> () const </td></tr>
<tr class="memdesc:a5b0cfbb970153b563c7134c1e8ba8319"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of bytes read or written by the last IO call. <a href="#a5b0cfbb970153b563c7134c1e8ba8319"></a><br/></td></tr>
<tr class="separator:a5b0cfbb970153b563c7134c1e8ba8319"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0cfe7a2aaf5749041076b38249404b20"><td class="memItemLeft" align="right" valign="top"><a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a0cfe7a2aaf5749041076b38249404b20">LastReadCount</a> () const </td></tr>
<tr class="memdesc:a0cfe7a2aaf5749041076b38249404b20"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of bytes read by the last <a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2" title="Read up to the given number of bytes from the socket.">Read()</a> or <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a> call (receive direction only). <a href="#a0cfe7a2aaf5749041076b38249404b20"></a><br/></td></tr>
<tr class="separator:a0cfe7a2aaf5749041076b38249404b20"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0af60002ca2775490ad8bcd937591829"><td class="memItemLeft" align="right" valign="top"><a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a0af60002ca2775490ad8bcd937591829">LastWriteCount</a> () const </td></tr>
<tr class="memdesc:a0af60002ca2775490ad8bcd937591829"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of bytes written by the last <a class="el" href="classwx_socket_base.html#a7676f1821d2e17db95de2438346355cd" title="Write up to the given number of bytes to the socket.">Write()</a> or <a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a> call (transmit direction only). <a href="#a0af60002ca2775490ad8bcd937591829"></a><br/></td></tr>
<tr class="separator:a0af60002ca2775490ad8bcd937591829"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4b3fa4395c33fd4f99956a5585e49b2e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6">wxSocketError</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a4b3fa4395c33fd4f99956a5585e49b2e">LastError</a> () const </td></tr>
<tr class="memdesc:a4b3fa4395c33fd4f99956a5585e49b2e"><td class="mdescLeft"> </td><td class="mdescRight">Returns the last wxSocket error. <a href="#a4b3fa4395c33fd4f99956a5585e49b2e"></a><br/></td></tr>
<tr class="separator:a4b3fa4395c33fd4f99956a5585e49b2e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a386797430bfc9f568be388e7abf6c782"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a386797430bfc9f568be388e7abf6c782">RestoreState</a> ()</td></tr>
<tr class="memdesc:a386797430bfc9f568be388e7abf6c782"><td class="mdescLeft"> </td><td class="mdescRight">Restore the previous state of the socket, as saved with <a class="el" href="classwx_socket_base.html#af227621ab1ee04542063fe91ea281e49" title="Save the current state of the socket in a stack.">SaveState()</a>. <a href="#a386797430bfc9f568be388e7abf6c782"></a><br/></td></tr>
<tr class="separator:a386797430bfc9f568be388e7abf6c782"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af227621ab1ee04542063fe91ea281e49"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#af227621ab1ee04542063fe91ea281e49">SaveState</a> ()</td></tr>
<tr class="memdesc:af227621ab1ee04542063fe91ea281e49"><td class="mdescLeft"> </td><td class="mdescRight">Save the current state of the socket in a stack. <a href="#af227621ab1ee04542063fe91ea281e49"></a><br/></td></tr>
<tr class="separator:af227621ab1ee04542063fe91ea281e49"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Basic I/O</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>See also: <a class="el" href="classwx_socket_server.html#a3e0998c069bf8b3ef447167faf00ebae" title="Wait for an incoming connection.">wxSocketServer::WaitForAccept()</a>, <a class="el" href="classwx_socket_client.html#a83c92e8c27a72c3610c9eb0b60e92d74" title="Wait until a connection request completes, or until the specified timeout elapses.">wxSocketClient::WaitOnConnect()</a> </p>
</div></td></tr>
<tr class="memitem:a054754d97e15427949ffa30af8ce9945"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a054754d97e15427949ffa30af8ce9945">Close</a> ()</td></tr>
<tr class="memdesc:a054754d97e15427949ffa30af8ce9945"><td class="mdescLeft"> </td><td class="mdescRight">Shut down the socket, disabling further transmission and reception of data and disable events for the socket and frees the associated system resources. <a href="#a054754d97e15427949ffa30af8ce9945"></a><br/></td></tr>
<tr class="separator:a054754d97e15427949ffa30af8ce9945"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a90d2aea95b10c68eee2656860d90e23e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a90d2aea95b10c68eee2656860d90e23e">ShutdownOutput</a> ()</td></tr>
<tr class="memdesc:a90d2aea95b10c68eee2656860d90e23e"><td class="mdescLeft"> </td><td class="mdescRight">Shuts down the writing end of the socket. <a href="#a90d2aea95b10c68eee2656860d90e23e"></a><br/></td></tr>
<tr class="separator:a90d2aea95b10c68eee2656860d90e23e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5cfc8b791cff6723dd499509d99d02be"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_socket_base.html">wxSocketBase</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a5cfc8b791cff6723dd499509d99d02be">Discard</a> ()</td></tr>
<tr class="memdesc:a5cfc8b791cff6723dd499509d99d02be"><td class="mdescLeft"> </td><td class="mdescRight">Delete all bytes in the incoming queue. <a href="#a5cfc8b791cff6723dd499509d99d02be"></a><br/></td></tr>
<tr class="separator:a5cfc8b791cff6723dd499509d99d02be"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1eecc8010fa40587623778cf9902e661"><td class="memItemLeft" align="right" valign="top">wxSocketFlags </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a1eecc8010fa40587623778cf9902e661">GetFlags</a> () const </td></tr>
<tr class="memdesc:a1eecc8010fa40587623778cf9902e661"><td class="mdescLeft"> </td><td class="mdescRight">Returns current IO flags, as set with <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a> <a href="#a1eecc8010fa40587623778cf9902e661"></a><br/></td></tr>
<tr class="separator:a1eecc8010fa40587623778cf9902e661"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a89897c3ea99e6e3d8d5daf8e26596bc3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a89897c3ea99e6e3d8d5daf8e26596bc3">InterruptWait</a> ()</td></tr>
<tr class="memdesc:a89897c3ea99e6e3d8d5daf8e26596bc3"><td class="mdescLeft"> </td><td class="mdescRight">Use this function to interrupt any wait operation currently in progress. <a href="#a89897c3ea99e6e3d8d5daf8e26596bc3"></a><br/></td></tr>
<tr class="separator:a89897c3ea99e6e3d8d5daf8e26596bc3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a944eb846a3849dd34f7825cfdce3bcd1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_socket_base.html">wxSocketBase</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a944eb846a3849dd34f7825cfdce3bcd1">Peek</a> (void *buffer, <a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> nbytes)</td></tr>
<tr class="memdesc:a944eb846a3849dd34f7825cfdce3bcd1"><td class="mdescLeft"> </td><td class="mdescRight">Peek into the socket by copying the next bytes which would be read by <a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2" title="Read up to the given number of bytes from the socket.">Read()</a> into the provided buffer. <a href="#a944eb846a3849dd34f7825cfdce3bcd1"></a><br/></td></tr>
<tr class="separator:a944eb846a3849dd34f7825cfdce3bcd1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa75b3c2dd051a012cfbd0596d95f80c2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_socket_base.html">wxSocketBase</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2">Read</a> (void *buffer, <a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> nbytes)</td></tr>
<tr class="memdesc:aa75b3c2dd051a012cfbd0596d95f80c2"><td class="mdescLeft"> </td><td class="mdescRight">Read up to the given number of bytes from the socket. <a href="#aa75b3c2dd051a012cfbd0596d95f80c2"></a><br/></td></tr>
<tr class="separator:aa75b3c2dd051a012cfbd0596d95f80c2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7c16b20282272c68acfe04107d430bf6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_socket_base.html">wxSocketBase</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6">ReadMsg</a> (void *buffer, <a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> nbytes)</td></tr>
<tr class="memdesc:a7c16b20282272c68acfe04107d430bf6"><td class="mdescLeft"> </td><td class="mdescRight">Receive a message sent by <a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a>. <a href="#a7c16b20282272c68acfe04107d430bf6"></a><br/></td></tr>
<tr class="separator:a7c16b20282272c68acfe04107d430bf6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa11d1db40c87c8e06e3f9849a08abafc"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc">SetFlags</a> (wxSocketFlags flags)</td></tr>
<tr class="memdesc:aa11d1db40c87c8e06e3f9849a08abafc"><td class="mdescLeft"> </td><td class="mdescRight">Use SetFlags to customize IO operation for this socket. <a href="#aa11d1db40c87c8e06e3f9849a08abafc"></a><br/></td></tr>
<tr class="separator:aa11d1db40c87c8e06e3f9849a08abafc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a18b26d4201f86daf64c881433c68a1b3"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a18b26d4201f86daf64c881433c68a1b3">SetLocal</a> (const <a class="el" href="classwx_i_p_v4address.html">wxIPV4address</a> &local)</td></tr>
<tr class="memdesc:a18b26d4201f86daf64c881433c68a1b3"><td class="mdescLeft"> </td><td class="mdescRight">Set the local address and port to use. <a href="#a18b26d4201f86daf64c881433c68a1b3"></a><br/></td></tr>
<tr class="separator:a18b26d4201f86daf64c881433c68a1b3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac24247e3f866154825c14de46a911e50"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#ac24247e3f866154825c14de46a911e50">SetTimeout</a> (long seconds)</td></tr>
<tr class="memdesc:ac24247e3f866154825c14de46a911e50"><td class="mdescLeft"> </td><td class="mdescRight">Set the default socket timeout in seconds. <a href="#ac24247e3f866154825c14de46a911e50"></a><br/></td></tr>
<tr class="separator:ac24247e3f866154825c14de46a911e50"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8fd912526830f7b079ac28677424d40a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_socket_base.html">wxSocketBase</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a8fd912526830f7b079ac28677424d40a">Unread</a> (const void *buffer, <a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> nbytes)</td></tr>
<tr class="memdesc:a8fd912526830f7b079ac28677424d40a"><td class="mdescLeft"> </td><td class="mdescRight">Put the specified data into the input queue. <a href="#a8fd912526830f7b079ac28677424d40a"></a><br/></td></tr>
<tr class="separator:a8fd912526830f7b079ac28677424d40a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae46d0dea0ec25af581ba3119cca4bd7e"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#ae46d0dea0ec25af581ba3119cca4bd7e">Wait</a> (long seconds=-1, long millisecond=0)</td></tr>
<tr class="memdesc:ae46d0dea0ec25af581ba3119cca4bd7e"><td class="mdescLeft"> </td><td class="mdescRight">Wait for any socket event. <a href="#ae46d0dea0ec25af581ba3119cca4bd7e"></a><br/></td></tr>
<tr class="separator:ae46d0dea0ec25af581ba3119cca4bd7e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a80e8a0feaed33843aa7972c02909106c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a80e8a0feaed33843aa7972c02909106c">WaitForLost</a> (long seconds=-1, long millisecond=0)</td></tr>
<tr class="memdesc:a80e8a0feaed33843aa7972c02909106c"><td class="mdescLeft"> </td><td class="mdescRight">Wait until the connection is lost. <a href="#a80e8a0feaed33843aa7972c02909106c"></a><br/></td></tr>
<tr class="separator:a80e8a0feaed33843aa7972c02909106c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aab8fdd558f149d70ed265dad0f12e9f8"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#aab8fdd558f149d70ed265dad0f12e9f8">WaitForRead</a> (long seconds=-1, long millisecond=0)</td></tr>
<tr class="memdesc:aab8fdd558f149d70ed265dad0f12e9f8"><td class="mdescLeft"> </td><td class="mdescRight">Wait until the socket is readable. <a href="#aab8fdd558f149d70ed265dad0f12e9f8"></a><br/></td></tr>
<tr class="separator:aab8fdd558f149d70ed265dad0f12e9f8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abda804254aa40c9f8ae363dbc5ebc1f2"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#abda804254aa40c9f8ae363dbc5ebc1f2">WaitForWrite</a> (long seconds=-1, long millisecond=0)</td></tr>
<tr class="memdesc:abda804254aa40c9f8ae363dbc5ebc1f2"><td class="mdescLeft"> </td><td class="mdescRight">Wait until the socket becomes writable. <a href="#abda804254aa40c9f8ae363dbc5ebc1f2"></a><br/></td></tr>
<tr class="separator:abda804254aa40c9f8ae363dbc5ebc1f2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7676f1821d2e17db95de2438346355cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_socket_base.html">wxSocketBase</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a7676f1821d2e17db95de2438346355cd">Write</a> (const void *buffer, <a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> nbytes)</td></tr>
<tr class="memdesc:a7676f1821d2e17db95de2438346355cd"><td class="mdescLeft"> </td><td class="mdescRight">Write up to the given number of bytes to the socket. <a href="#a7676f1821d2e17db95de2438346355cd"></a><br/></td></tr>
<tr class="separator:a7676f1821d2e17db95de2438346355cd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a91abca66c1d5bf4237aa87b0e796464b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_socket_base.html">wxSocketBase</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b">WriteMsg</a> (const void *buffer, <a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> nbytes)</td></tr>
<tr class="memdesc:a91abca66c1d5bf4237aa87b0e796464b"><td class="mdescLeft"> </td><td class="mdescRight">Sends a buffer which can be read using <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a>. <a href="#a91abca66c1d5bf4237aa87b0e796464b"></a><br/></td></tr>
<tr class="separator:a91abca66c1d5bf4237aa87b0e796464b"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Handling Socket Events</div></td></tr>
<tr class="memitem:a9dd69ce31cb441c2c47e374256fabcc4"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a9dd69ce31cb441c2c47e374256fabcc4">GetClientData</a> () const </td></tr>
<tr class="memdesc:a9dd69ce31cb441c2c47e374256fabcc4"><td class="mdescLeft"> </td><td class="mdescRight">Returns a pointer of the client data for this socket, as set with <a class="el" href="classwx_socket_base.html#a5695e6dc7db8e4119caf3c81dcbc7306" title="Sets user-supplied client data for this socket.">SetClientData()</a> <a href="#a9dd69ce31cb441c2c47e374256fabcc4"></a><br/></td></tr>
<tr class="separator:a9dd69ce31cb441c2c47e374256fabcc4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acfaca539bd0fe0e9c0b1018c77e6701c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#acfaca539bd0fe0e9c0b1018c77e6701c">Notify</a> (bool notify)</td></tr>
<tr class="memdesc:acfaca539bd0fe0e9c0b1018c77e6701c"><td class="mdescLeft"> </td><td class="mdescRight">According to the <em>notify</em> value, this function enables or disables socket events. <a href="#acfaca539bd0fe0e9c0b1018c77e6701c"></a><br/></td></tr>
<tr class="separator:acfaca539bd0fe0e9c0b1018c77e6701c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5695e6dc7db8e4119caf3c81dcbc7306"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a5695e6dc7db8e4119caf3c81dcbc7306">SetClientData</a> (void *data)</td></tr>
<tr class="memdesc:a5695e6dc7db8e4119caf3c81dcbc7306"><td class="mdescLeft"> </td><td class="mdescRight">Sets user-supplied client data for this socket. <a href="#a5695e6dc7db8e4119caf3c81dcbc7306"></a><br/></td></tr>
<tr class="separator:a5695e6dc7db8e4119caf3c81dcbc7306"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a09819e56d36638fb6b45bf3dd7ea8742"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a09819e56d36638fb6b45bf3dd7ea8742">SetEventHandler</a> (<a class="el" href="classwx_evt_handler.html">wxEvtHandler</a> &handler, int id=-1)</td></tr>
<tr class="memdesc:a09819e56d36638fb6b45bf3dd7ea8742"><td class="mdescLeft"> </td><td class="mdescRight">Sets an event handler to be called when a socket event occurs. <a href="#a09819e56d36638fb6b45bf3dd7ea8742"></a><br/></td></tr>
<tr class="separator:a09819e56d36638fb6b45bf3dd7ea8742"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4a3883a253c29e0f0027d279c647dbe0"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a4a3883a253c29e0f0027d279c647dbe0">SetNotify</a> (<a class="el" href="socket_8h.html#a2ec8996eecae7da1c5fa77c88a45a353">wxSocketEventFlags</a> flags)</td></tr>
<tr class="memdesc:a4a3883a253c29e0f0027d279c647dbe0"><td class="mdescLeft"> </td><td class="mdescRight">Specifies which socket events are to be sent to the event handler. <a href="#a4a3883a253c29e0f0027d279c647dbe0"></a><br/></td></tr>
<tr class="separator:a4a3883a253c29e0f0027d279c647dbe0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3d403e292ada2a6e01b5f9d2908aefbe"><td class="memItemLeft" align="right" valign="top"><a class="el" href="socket_8h.html#aa6e1c1635ef97512c7a0d0c0c7a5db31">wxSOCKET_T</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html#a3d403e292ada2a6e01b5f9d2908aefbe">GetSocket</a> () const </td></tr>
<tr class="memdesc:a3d403e292ada2a6e01b5f9d2908aefbe"><td class="mdescLeft"> </td><td class="mdescRight">Returns the native socket descriptor. <a href="#a3d403e292ada2a6e01b5f9d2908aefbe"></a><br/></td></tr>
<tr class="separator:a3d403e292ada2a6e01b5f9d2908aefbe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classwx_object"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classwx_object')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classwx_object.html">wxObject</a></td></tr>
<tr class="memitem:acaa378363a28af421ab56ad7b46eadf0 inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#acaa378363a28af421ab56ad7b46eadf0">wxObject</a> ()</td></tr>
<tr class="memdesc:acaa378363a28af421ab56ad7b46eadf0 inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Default ctor; initializes to <span class="literal">NULL</span> the internal reference data. <a href="#acaa378363a28af421ab56ad7b46eadf0"></a><br/></td></tr>
<tr class="separator:acaa378363a28af421ab56ad7b46eadf0 inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4721b4dc9b7aff0f30904ba2ea3954cf inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#a4721b4dc9b7aff0f30904ba2ea3954cf">wxObject</a> (const <a class="el" href="classwx_object.html">wxObject</a> &other)</td></tr>
<tr class="memdesc:a4721b4dc9b7aff0f30904ba2ea3954cf inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Copy ctor. <a href="#a4721b4dc9b7aff0f30904ba2ea3954cf"></a><br/></td></tr>
<tr class="separator:a4721b4dc9b7aff0f30904ba2ea3954cf inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2a51aa8bfbab47ca2f051bcf84b3f35b inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#a2a51aa8bfbab47ca2f051bcf84b3f35b">~wxObject</a> ()</td></tr>
<tr class="memdesc:a2a51aa8bfbab47ca2f051bcf84b3f35b inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a2a51aa8bfbab47ca2f051bcf84b3f35b"></a><br/></td></tr>
<tr class="separator:a2a51aa8bfbab47ca2f051bcf84b3f35b inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab3a0c6f723cbaddb47be4e8dd98cc8e2 inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classwx_class_info.html">wxClassInfo</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#ab3a0c6f723cbaddb47be4e8dd98cc8e2">GetClassInfo</a> () const </td></tr>
<tr class="memdesc:ab3a0c6f723cbaddb47be4e8dd98cc8e2 inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">This virtual function is redefined for every class that requires run-time type information, when using the <a class="el" href="group__group__funcmacro__rtti.html#ga20465fc7e022e29a5dacfad46e152e75" title="Used inside a class declaration to declare that the class should be made known to the class hierarchy...">wxDECLARE_CLASS</a> macro (or similar). <a href="#ab3a0c6f723cbaddb47be4e8dd98cc8e2"></a><br/></td></tr>
<tr class="separator:ab3a0c6f723cbaddb47be4e8dd98cc8e2 inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aabdb4fc957226544a8408167844e4f42 inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_object_ref_data.html">wxObjectRefData</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#aabdb4fc957226544a8408167844e4f42">GetRefData</a> () const </td></tr>
<tr class="memdesc:aabdb4fc957226544a8408167844e4f42 inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <a class="el" href="classwx_object.html#a9e31954530a0abd54982effc443ed2b8" title="Pointer to an object which is the object's reference-counted data.">wxObject::m_refData</a> pointer, i.e. the data referenced by this object. <a href="#aabdb4fc957226544a8408167844e4f42"></a><br/></td></tr>
<tr class="separator:aabdb4fc957226544a8408167844e4f42 inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af40d580385cf4f8112fae7713404b01e inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#af40d580385cf4f8112fae7713404b01e">IsKindOf</a> (const <a class="el" href="classwx_class_info.html">wxClassInfo</a> *info) const </td></tr>
<tr class="memdesc:af40d580385cf4f8112fae7713404b01e inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Determines whether this class is a subclass of (or the same class as) the given class. <a href="#af40d580385cf4f8112fae7713404b01e"></a><br/></td></tr>
<tr class="separator:af40d580385cf4f8112fae7713404b01e inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a80a1a3fda7b14396a9ddd3d7a46a88bd inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#a80a1a3fda7b14396a9ddd3d7a46a88bd">IsSameAs</a> (const <a class="el" href="classwx_object.html">wxObject</a> &obj) const </td></tr>
<tr class="memdesc:a80a1a3fda7b14396a9ddd3d7a46a88bd inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if this object has the same data pointer as <em>obj</em>. <a href="#a80a1a3fda7b14396a9ddd3d7a46a88bd"></a><br/></td></tr>
<tr class="separator:a80a1a3fda7b14396a9ddd3d7a46a88bd inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2f6f1aa51fe9fc2b1415ca4211a90e9e inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#a2f6f1aa51fe9fc2b1415ca4211a90e9e">Ref</a> (const <a class="el" href="classwx_object.html">wxObject</a> &clone)</td></tr>
<tr class="memdesc:a2f6f1aa51fe9fc2b1415ca4211a90e9e inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Makes this object refer to the data in <em>clone</em>. <a href="#a2f6f1aa51fe9fc2b1415ca4211a90e9e"></a><br/></td></tr>
<tr class="separator:a2f6f1aa51fe9fc2b1415ca4211a90e9e inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afab780710f2adc1bb33310e27590140b inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#afab780710f2adc1bb33310e27590140b">SetRefData</a> (<a class="el" href="classwx_object_ref_data.html">wxObjectRefData</a> *data)</td></tr>
<tr class="memdesc:afab780710f2adc1bb33310e27590140b inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Sets the <a class="el" href="classwx_object.html#a9e31954530a0abd54982effc443ed2b8" title="Pointer to an object which is the object's reference-counted data.">wxObject::m_refData</a> pointer. <a href="#afab780710f2adc1bb33310e27590140b"></a><br/></td></tr>
<tr class="separator:afab780710f2adc1bb33310e27590140b inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af51efc6b1ae632fc7f0cd7ebbce9fa36 inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#af51efc6b1ae632fc7f0cd7ebbce9fa36">UnRef</a> ()</td></tr>
<tr class="memdesc:af51efc6b1ae632fc7f0cd7ebbce9fa36 inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Decrements the reference count in the associated data, and if it is zero, deletes the data. <a href="#af51efc6b1ae632fc7f0cd7ebbce9fa36"></a><br/></td></tr>
<tr class="separator:af51efc6b1ae632fc7f0cd7ebbce9fa36 inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a74b40e42d19a4b9e9bec0b57d62a5725 inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#a74b40e42d19a4b9e9bec0b57d62a5725">UnShare</a> ()</td></tr>
<tr class="memdesc:a74b40e42d19a4b9e9bec0b57d62a5725 inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">This is the same of <a class="el" href="classwx_object.html#a60204063f3cc3aa2fa1c7ff5bda9eb13" title="Ensure that this object's data is not shared with any other object.">AllocExclusive()</a> but this method is public. <a href="#a74b40e42d19a4b9e9bec0b57d62a5725"></a><br/></td></tr>
<tr class="separator:a74b40e42d19a4b9e9bec0b57d62a5725 inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a07b8f34f5afc5743195c5fed052f55d3 inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#a07b8f34f5afc5743195c5fed052f55d3">operator delete</a> (void *buf)</td></tr>
<tr class="memdesc:a07b8f34f5afc5743195c5fed052f55d3 inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">The <em>delete</em> operator is defined for debugging versions of the library only, when the identifier <code><b>WXDEBUG</b></code> is defined. <a href="#a07b8f34f5afc5743195c5fed052f55d3"></a><br/></td></tr>
<tr class="separator:a07b8f34f5afc5743195c5fed052f55d3 inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a96fa423a1dbc212c8227a5d83825971f inherit pub_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#a96fa423a1dbc212c8227a5d83825971f">operator new</a> (size_t size, const <a class="el" href="classwx_string.html">wxString</a> &filename=NULL, int lineNum=0)</td></tr>
<tr class="memdesc:a96fa423a1dbc212c8227a5d83825971f inherit pub_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">The <em>new</em> operator is defined for debugging versions of the library only, when the identifier <code><b>WXDEBUG</b></code> is defined. <a href="#a96fa423a1dbc212c8227a5d83825971f"></a><br/></td></tr>
<tr class="separator:a96fa423a1dbc212c8227a5d83825971f inherit pub_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_methods_classwx_object"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classwx_object')"><img src="closed.png" alt="-"/> Protected Member Functions inherited from <a class="el" href="classwx_object.html">wxObject</a></td></tr>
<tr class="memitem:a60204063f3cc3aa2fa1c7ff5bda9eb13 inherit pro_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#a60204063f3cc3aa2fa1c7ff5bda9eb13">AllocExclusive</a> ()</td></tr>
<tr class="memdesc:a60204063f3cc3aa2fa1c7ff5bda9eb13 inherit pro_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Ensure that this object's data is not shared with any other object. <a href="#a60204063f3cc3aa2fa1c7ff5bda9eb13"></a><br/></td></tr>
<tr class="separator:a60204063f3cc3aa2fa1c7ff5bda9eb13 inherit pro_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a95c6a5e4e1e03ff23c7b9efe4cff0c1a inherit pro_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classwx_object_ref_data.html">wxObjectRefData</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#a95c6a5e4e1e03ff23c7b9efe4cff0c1a">CreateRefData</a> () const </td></tr>
<tr class="memdesc:a95c6a5e4e1e03ff23c7b9efe4cff0c1a inherit pro_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it. <a href="#a95c6a5e4e1e03ff23c7b9efe4cff0c1a"></a><br/></td></tr>
<tr class="separator:a95c6a5e4e1e03ff23c7b9efe4cff0c1a inherit pro_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1d39f1d3650fe0982c9a1abe7f9fe7b7 inherit pro_methods_classwx_object"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classwx_object_ref_data.html">wxObjectRefData</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#a1d39f1d3650fe0982c9a1abe7f9fe7b7">CloneRefData</a> (const <a class="el" href="classwx_object_ref_data.html">wxObjectRefData</a> *data) const </td></tr>
<tr class="memdesc:a1d39f1d3650fe0982c9a1abe7f9fe7b7 inherit pro_methods_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying <em>data</em>. <a href="#a1d39f1d3650fe0982c9a1abe7f9fe7b7"></a><br/></td></tr>
<tr class="separator:a1d39f1d3650fe0982c9a1abe7f9fe7b7 inherit pro_methods_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pro_attribs_classwx_object"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classwx_object')"><img src="closed.png" alt="-"/> Protected Attributes inherited from <a class="el" href="classwx_object.html">wxObject</a></td></tr>
<tr class="memitem:a9e31954530a0abd54982effc443ed2b8 inherit pro_attribs_classwx_object"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_object_ref_data.html">wxObjectRefData</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_object.html#a9e31954530a0abd54982effc443ed2b8">m_refData</a></td></tr>
<tr class="memdesc:a9e31954530a0abd54982effc443ed2b8 inherit pro_attribs_classwx_object"><td class="mdescLeft"> </td><td class="mdescRight">Pointer to an object which is the object's reference-counted data. <a href="#a9e31954530a0abd54982effc443ed2b8"></a><br/></td></tr>
<tr class="separator:a9e31954530a0abd54982effc443ed2b8 inherit pro_attribs_classwx_object"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="a3bf32997db6732a5b053d8d52b1173f0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxSocketBase::wxSocketBase </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default constructor. </p>
<p>Don't use it directly; instead, use <a class="el" href="classwx_socket_client.html">wxSocketClient</a> to construct a socket client, or <a class="el" href="classwx_socket_server.html">wxSocketServer</a> to construct a socket server. </p>
</div>
</div>
<a class="anchor" id="a636e72242dd5550e84456c277ca31222"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual wxSocketBase::~wxSocketBase </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
<p>Do not destroy a socket using the delete operator directly; use <a class="el" href="classwx_socket_base.html#ab0b0926cfdfdd00b8b5c5f7f57cea861" title="Destroys the socket safely.">Destroy()</a> instead. Also, do not create socket objects in the stack. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a054754d97e15427949ffa30af8ce9945"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual bool wxSocketBase::Close </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Shut down the socket, disabling further transmission and reception of data and disable events for the socket and frees the associated system resources. </p>
<p>Upon socket destruction, <a class="el" href="classwx_socket_base.html#a054754d97e15427949ffa30af8ce9945" title="Shut down the socket, disabling further transmission and reception of data and disable events for the...">Close()</a> is automatically called, so in most cases you won't need to do it yourself, unless you explicitly want to shut down the socket, typically to notify the peer that you are closing the connection.</p>
<dl class="section remark"><dt>Remarks</dt><dd>Although <a class="el" href="classwx_socket_base.html#a054754d97e15427949ffa30af8ce9945" title="Shut down the socket, disabling further transmission and reception of data and disable events for the...">Close()</a> immediately disables events for the socket, it is possible that event messages may be waiting in the application's event queue. The application must therefore be prepared to handle socket event messages even after calling <a class="el" href="classwx_socket_base.html#a054754d97e15427949ffa30af8ce9945" title="Shut down the socket, disabling further transmission and reception of data and disable events for the...">Close()</a>. </dd></dl>
<p>Reimplemented in <a class="el" href="classwx_f_t_p.html#ae7e072cefb173542f20946cd50ef6213">wxFTP</a>.</p>
</div>
</div>
<a class="anchor" id="ab0b0926cfdfdd00b8b5c5f7f57cea861"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxSocketBase::Destroy </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Destroys the socket safely. </p>
<p>Use this function instead of the delete operator, since otherwise socket events could reach the application even after the socket has been destroyed. To prevent this problem, this function appends the wxSocket to a list of object to be deleted on idle time, after all events have been processed. For the same reason, you should avoid creating socket objects in the stack.</p>
<p><a class="el" href="classwx_socket_base.html#ab0b0926cfdfdd00b8b5c5f7f57cea861" title="Destroys the socket safely.">Destroy()</a> calls <a class="el" href="classwx_socket_base.html#a054754d97e15427949ffa30af8ce9945" title="Shut down the socket, disabling further transmission and reception of data and disable events for the...">Close()</a> automatically.</p>
<dl class="section return"><dt>Returns</dt><dd>Always <span class="literal">true</span>. </dd></dl>
</div>
</div>
<a class="anchor" id="a5cfc8b791cff6723dd499509d99d02be"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_socket_base.html">wxSocketBase</a>& wxSocketBase::Discard </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Delete all bytes in the incoming queue. </p>
<p>This function always returns immediately and its operation is not affected by IO flags.</p>
<p>Use <a class="el" href="classwx_socket_base.html#a5b0cfbb970153b563c7134c1e8ba8319" title="Returns the number of bytes read or written by the last IO call.">LastCount()</a> to verify the number of bytes actually discarded.</p>
<p>If you use <a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a>, it will always return <span class="literal">false</span>. </p>
</div>
</div>
<a class="anchor" id="a1a70bf5e24ccf3a6171ba07c06f8dac9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxSocketBase::Error </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if an error occurred in the last IO operation. </p>
<p>Use this function to check for an error condition after one of the following calls: <a class="el" href="classwx_socket_base.html#a5cfc8b791cff6723dd499509d99d02be" title="Delete all bytes in the incoming queue.">Discard()</a>, <a class="el" href="classwx_socket_base.html#a944eb846a3849dd34f7825cfdce3bcd1" title="Peek into the socket by copying the next bytes which would be read by Read() into the provided buffer...">Peek()</a>, <a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2" title="Read up to the given number of bytes from the socket.">Read()</a>, <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a>, <a class="el" href="classwx_socket_base.html#a8fd912526830f7b079ac28677424d40a" title="Put the specified data into the input queue.">Unread()</a>, <a class="el" href="classwx_socket_base.html#a7676f1821d2e17db95de2438346355cd" title="Write up to the given number of bytes to the socket.">Write()</a>, <a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a>. </p>
</div>
</div>
<a class="anchor" id="a9dd69ce31cb441c2c47e374256fabcc4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void* wxSocketBase::GetClientData </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a pointer of the client data for this socket, as set with <a class="el" href="classwx_socket_base.html#a5695e6dc7db8e4119caf3c81dcbc7306" title="Sets user-supplied client data for this socket.">SetClientData()</a> </p>
</div>
</div>
<a class="anchor" id="a1eecc8010fa40587623778cf9902e661"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxSocketFlags wxSocketBase::GetFlags </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns current IO flags, as set with <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a> </p>
</div>
</div>
<a class="anchor" id="a1751b32af0172a30f544068100ba90d2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual bool wxSocketBase::GetLocal </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classwx_sock_address.html">wxSockAddress</a> & </td>
<td class="paramname"><em>addr</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the local address of the socket. </p>
<dl class="section return"><dt>Returns</dt><dd><span class="literal">true</span> if no error happened, <span class="literal">false</span> otherwise. </dd></dl>
</div>
</div>
<a class="anchor" id="aae825b5309067c212640189d6ad7e993"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual bool wxSocketBase::GetPeer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classwx_sock_address.html">wxSockAddress</a> & </td>
<td class="paramname"><em>addr</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the peer address field of the socket. </p>
<dl class="section return"><dt>Returns</dt><dd><span class="literal">true</span> if no error happened, <span class="literal">false</span> otherwise. </dd></dl>
</div>
</div>
<a class="anchor" id="a3d403e292ada2a6e01b5f9d2908aefbe"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="socket_8h.html#aa6e1c1635ef97512c7a0d0c0c7a5db31">wxSOCKET_T</a> wxSocketBase::GetSocket </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the native socket descriptor. </p>
<p>This is intended to use with rarely used specific platform features that can only be accessed via the actual socket descriptor.</p>
<p>Do not use this for reading or writing data from or to the socket as this would almost surely interfere with wxSocket code logic and result in unexpected behaviour.</p>
<p>The socket must be successfully initialized, e.g. connected for client sockets, before this method can be called.</p>
<dl class="section return"><dt>Returns</dt><dd>Returns the native socket descriptor.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>2.9.5 </dd></dl>
</div>
</div>
<a class="anchor" id="adb940bb2853901b4ea0b2840964f8e5b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">long wxSocketBase::GetTimeout </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the socket timeout in seconds. </p>
<p>The timeout can be set using <a class="el" href="classwx_socket_base.html#ac24247e3f866154825c14de46a911e50" title="Set the default socket timeout in seconds.">SetTimeout()</a> and is 10 minutes by default. </p>
</div>
</div>
<a class="anchor" id="a4c4c4cc8e1fcd824ef621b0f3d17b29f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool wxSocketBase::Initialize </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Perform the initialization needed in order to use the sockets. </p>
<p>This function is called from wxSocket constructor implicitly and so normally doesn't need to be called explicitly. There is however one important exception: as this function must be called from the main (UI) thread, if you use wxSocket from multiple threads you must call <a class="el" href="classwx_socket_base.html#a4c4c4cc8e1fcd824ef621b0f3d17b29f" title="Perform the initialization needed in order to use the sockets.">Initialize()</a> from the main thread before creating wxSocket objects in the other ones.</p>
<p>It is safe to call this function multiple times (only the first call does anything) but you must call <a class="el" href="classwx_socket_base.html#acfa7398ce7fac6e8db20caeb3a09b10e" title="Shut down the sockets.">Shutdown()</a> exactly once for every call to <a class="el" href="classwx_socket_base.html#a4c4c4cc8e1fcd824ef621b0f3d17b29f" title="Perform the initialization needed in order to use the sockets.">Initialize()</a>.</p>
<p>This function should only be called from the main thread.</p>
<dl class="section return"><dt>Returns</dt><dd><span class="literal">true</span> if the sockets can be used, <span class="literal">false</span> if the initialization failed and sockets are not available at all. </dd></dl>
</div>
</div>
<a class="anchor" id="a89897c3ea99e6e3d8d5daf8e26596bc3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxSocketBase::InterruptWait </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Use this function to interrupt any wait operation currently in progress. </p>
<p>Note that this is not intended as a regular way to interrupt a Wait call, but only as an escape mechanism for exceptional situations where it is absolutely necessary to use it, for example to abort an operation due to some exception or abnormal problem. InterruptWait is automatically called when you <a class="el" href="classwx_socket_base.html#a054754d97e15427949ffa30af8ce9945" title="Shut down the socket, disabling further transmission and reception of data and disable events for the...">Close()</a> a socket (and thus also upon socket destruction), so you don't need to use it in these cases.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#ae46d0dea0ec25af581ba3119cca4bd7e" title="Wait for any socket event.">Wait()</a>, <a class="el" href="classwx_socket_base.html#a80e8a0feaed33843aa7972c02909106c" title="Wait until the connection is lost.">WaitForLost()</a>, <a class="el" href="classwx_socket_base.html#aab8fdd558f149d70ed265dad0f12e9f8" title="Wait until the socket is readable.">WaitForRead()</a>, <a class="el" href="classwx_socket_base.html#abda804254aa40c9f8ae363dbc5ebc1f2" title="Wait until the socket becomes writable.">WaitForWrite()</a>, <a class="el" href="classwx_socket_server.html#a3e0998c069bf8b3ef447167faf00ebae" title="Wait for an incoming connection.">wxSocketServer::WaitForAccept()</a>, <a class="el" href="classwx_socket_client.html#a83c92e8c27a72c3610c9eb0b60e92d74" title="Wait until a connection request completes, or until the specified timeout elapses.">wxSocketClient::WaitOnConnect()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a2d171f3eac0dbc9211f0032188d381ac"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxSocketBase::IsConnected </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if the socket is connected. </p>
</div>
</div>
<a class="anchor" id="a6703a3dd7c15fcb2eff7c7baf0b886f5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxSocketBase::IsData </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Check if the socket can be currently read or written. </p>
<p>This might mean that queued data is available for reading or, for streamed sockets, that the connection has been closed, so that a read operation will complete immediately without blocking (unless the <b>wxSOCKET_WAITALL</b> flag is set, in which case the operation might still block). </p>
</div>
</div>
<a class="anchor" id="ac5118b15195664969b7d914a045936f6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxSocketBase::IsDisconnected </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if the socket is not connected. </p>
</div>
</div>
<a class="anchor" id="a86799181fb499a72a42651704a3bbda3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxSocketBase::IsOk </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if the socket is initialized and ready and <span class="literal">false</span> in other cases. </p>
<dl class="section remark"><dt>Remarks</dt><dd>For <a class="el" href="classwx_socket_client.html">wxSocketClient</a>, <a class="el" href="classwx_socket_base.html#a86799181fb499a72a42651704a3bbda3" title="Returns true if the socket is initialized and ready and false in other cases.">IsOk()</a> won't return <span class="literal">true</span> unless the client is connected to a server. For <a class="el" href="classwx_socket_server.html">wxSocketServer</a>, <a class="el" href="classwx_socket_base.html#a86799181fb499a72a42651704a3bbda3" title="Returns true if the socket is initialized and ready and false in other cases.">IsOk()</a> will return <span class="literal">true</span> if the server could bind to the specified address and is already listening for new connections. <a class="el" href="classwx_socket_base.html#a86799181fb499a72a42651704a3bbda3" title="Returns true if the socket is initialized and ready and false in other cases.">IsOk()</a> does not check for IO errors; use <a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a> instead for that purpose. </dd></dl>
</div>
</div>
<a class="anchor" id="a5b0cfbb970153b563c7134c1e8ba8319"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> wxSocketBase::LastCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the number of bytes read or written by the last IO call. </p>
<p>Use this function to get the number of bytes actually transferred after using one of the following IO calls: <a class="el" href="classwx_socket_base.html#a5cfc8b791cff6723dd499509d99d02be" title="Delete all bytes in the incoming queue.">Discard()</a>, <a class="el" href="classwx_socket_base.html#a944eb846a3849dd34f7825cfdce3bcd1" title="Peek into the socket by copying the next bytes which would be read by Read() into the provided buffer...">Peek()</a>, <a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2" title="Read up to the given number of bytes from the socket.">Read()</a>, <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a>, <a class="el" href="classwx_socket_base.html#a8fd912526830f7b079ac28677424d40a" title="Put the specified data into the input queue.">Unread()</a>, <a class="el" href="classwx_socket_base.html#a7676f1821d2e17db95de2438346355cd" title="Write up to the given number of bytes to the socket.">Write()</a>, <a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a>.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000050">Deprecated:</a></b></dt><dd>This function is kept mostly for backwards compatibility. Use <a class="el" href="classwx_socket_base.html#a0cfe7a2aaf5749041076b38249404b20" title="Returns the number of bytes read by the last Read() or ReadMsg() call (receive direction only)...">LastReadCount()</a> or <a class="el" href="classwx_socket_base.html#a0af60002ca2775490ad8bcd937591829" title="Returns the number of bytes written by the last Write() or WriteMsg() call (transmit direction only)...">LastWriteCount()</a> instead. <a class="el" href="classwx_socket_base.html#a5b0cfbb970153b563c7134c1e8ba8319" title="Returns the number of bytes read or written by the last IO call.">LastCount()</a> is still needed for use with less commonly used functions: <a class="el" href="classwx_socket_base.html#a5cfc8b791cff6723dd499509d99d02be" title="Delete all bytes in the incoming queue.">Discard()</a>, <a class="el" href="classwx_socket_base.html#a944eb846a3849dd34f7825cfdce3bcd1" title="Peek into the socket by copying the next bytes which would be read by Read() into the provided buffer...">Peek()</a>, and <a class="el" href="classwx_socket_base.html#a8fd912526830f7b079ac28677424d40a" title="Put the specified data into the input queue.">Unread()</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="a4b3fa4395c33fd4f99956a5585e49b2e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6">wxSocketError</a> wxSocketBase::LastError </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the last wxSocket error. </p>
<p>See <a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6">wxSocketError</a> .</p>
<dl class="section note"><dt>Note</dt><dd>This function merely returns the last error code, but it should not be used to determine if an error has occurred (this is because successful operations do not change the LastError value). Use <a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a> first, in order to determine if the last IO call failed. If this returns <span class="literal">true</span>, use <a class="el" href="classwx_socket_base.html#a4b3fa4395c33fd4f99956a5585e49b2e" title="Returns the last wxSocket error.">LastError()</a> to discover the cause of the error. </dd></dl>
</div>
</div>
<a class="anchor" id="a0cfe7a2aaf5749041076b38249404b20"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> wxSocketBase::LastReadCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the number of bytes read by the last <a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2" title="Read up to the given number of bytes from the socket.">Read()</a> or <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a> call (receive direction only). </p>
<p>This function is thread-safe, in case <a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2" title="Read up to the given number of bytes from the socket.">Read()</a> is executed in a different thread than <a class="el" href="classwx_socket_base.html#a7676f1821d2e17db95de2438346355cd" title="Write up to the given number of bytes to the socket.">Write()</a>. Use <a class="el" href="classwx_socket_base.html#a0cfe7a2aaf5749041076b38249404b20" title="Returns the number of bytes read by the last Read() or ReadMsg() call (receive direction only)...">LastReadCount()</a> instead of <a class="el" href="classwx_socket_base.html#a5b0cfbb970153b563c7134c1e8ba8319" title="Returns the number of bytes read or written by the last IO call.">LastCount()</a> for this reason.</p>
<p>Unlike <a class="el" href="classwx_socket_base.html#a5b0cfbb970153b563c7134c1e8ba8319" title="Returns the number of bytes read or written by the last IO call.">LastCount()</a>, the functions <a class="el" href="classwx_socket_base.html#a5cfc8b791cff6723dd499509d99d02be" title="Delete all bytes in the incoming queue.">Discard()</a>, <a class="el" href="classwx_socket_base.html#a944eb846a3849dd34f7825cfdce3bcd1" title="Peek into the socket by copying the next bytes which would be read by Read() into the provided buffer...">Peek()</a>, and <a class="el" href="classwx_socket_base.html#a8fd912526830f7b079ac28677424d40a" title="Put the specified data into the input queue.">Unread()</a> are currently not supported by <a class="el" href="classwx_socket_base.html#a0cfe7a2aaf5749041076b38249404b20" title="Returns the number of bytes read by the last Read() or ReadMsg() call (receive direction only)...">LastReadCount()</a>.</p>
<dl class="section since"><dt>Since</dt><dd>2.9.5 </dd></dl>
</div>
</div>
<a class="anchor" id="a0af60002ca2775490ad8bcd937591829"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> wxSocketBase::LastWriteCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the number of bytes written by the last <a class="el" href="classwx_socket_base.html#a7676f1821d2e17db95de2438346355cd" title="Write up to the given number of bytes to the socket.">Write()</a> or <a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a> call (transmit direction only). </p>
<p>This function is thread-safe, in case <a class="el" href="classwx_socket_base.html#a7676f1821d2e17db95de2438346355cd" title="Write up to the given number of bytes to the socket.">Write()</a> is executed in a different thread than <a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2" title="Read up to the given number of bytes from the socket.">Read()</a>. Use <a class="el" href="classwx_socket_base.html#a0af60002ca2775490ad8bcd937591829" title="Returns the number of bytes written by the last Write() or WriteMsg() call (transmit direction only)...">LastWriteCount()</a> instead of <a class="el" href="classwx_socket_base.html#a5b0cfbb970153b563c7134c1e8ba8319" title="Returns the number of bytes read or written by the last IO call.">LastCount()</a> for this reason.</p>
<dl class="section since"><dt>Since</dt><dd>2.9.5 </dd></dl>
</div>
</div>
<a class="anchor" id="acfaca539bd0fe0e9c0b1018c77e6701c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxSocketBase::Notify </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"><em>notify</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>According to the <em>notify</em> value, this function enables or disables socket events. </p>
<p>If <em>notify</em> is <span class="literal">true</span>, the events configured with <a class="el" href="classwx_socket_base.html#a4a3883a253c29e0f0027d279c647dbe0" title="Specifies which socket events are to be sent to the event handler.">SetNotify()</a> will be sent to the application. If <em>notify</em> is <span class="literal">false</span>; no events will be sent. </p>
</div>
</div>
<a class="anchor" id="a944eb846a3849dd34f7825cfdce3bcd1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_socket_base.html">wxSocketBase</a>& wxSocketBase::Peek </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> </td>
<td class="paramname"><em>nbytes</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Peek into the socket by copying the next bytes which would be read by <a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2" title="Read up to the given number of bytes from the socket.">Read()</a> into the provided buffer. </p>
<p>Peeking a buffer doesn't delete it from the socket input queue, i.e. calling <a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2" title="Read up to the given number of bytes from the socket.">Read()</a> will return the same data.</p>
<p>Use <a class="el" href="classwx_socket_base.html#a5b0cfbb970153b563c7134c1e8ba8319" title="Returns the number of bytes read or written by the last IO call.">LastCount()</a> to verify the number of bytes actually peeked.</p>
<p>Use <a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a> to determine if the operation succeeded.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>Buffer where to put peeked data. </td></tr>
<tr><td class="paramname">nbytes</td><td>Number of bytes.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a reference to the current object.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>The exact behaviour of <a class="el" href="classwx_socket_base.html#a944eb846a3849dd34f7825cfdce3bcd1" title="Peek into the socket by copying the next bytes which would be read by Read() into the provided buffer...">Peek()</a> depends on the combination of flags being used. For a detailed explanation, see <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a></dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a>, <a class="el" href="classwx_socket_base.html#a4b3fa4395c33fd4f99956a5585e49b2e" title="Returns the last wxSocket error.">LastError()</a>, <a class="el" href="classwx_socket_base.html#a5b0cfbb970153b563c7134c1e8ba8319" title="Returns the number of bytes read or written by the last IO call.">LastCount()</a>, <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="aa75b3c2dd051a012cfbd0596d95f80c2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_socket_base.html">wxSocketBase</a>& wxSocketBase::Read </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> </td>
<td class="paramname"><em>nbytes</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Read up to the given number of bytes from the socket. </p>
<p>Use <a class="el" href="classwx_socket_base.html#a0cfe7a2aaf5749041076b38249404b20" title="Returns the number of bytes read by the last Read() or ReadMsg() call (receive direction only)...">LastReadCount()</a> to verify the number of bytes actually read. Use <a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a> to determine if the operation succeeded.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>Buffer where to put read data. </td></tr>
<tr><td class="paramname">nbytes</td><td>Number of bytes.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a reference to the current object.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>The exact behaviour of <a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2" title="Read up to the given number of bytes from the socket.">Read()</a> depends on the combination of flags being used. For a detailed explanation, see <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a></dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a>, <a class="el" href="classwx_socket_base.html#a4b3fa4395c33fd4f99956a5585e49b2e" title="Returns the last wxSocket error.">LastError()</a>, <a class="el" href="classwx_socket_base.html#a0cfe7a2aaf5749041076b38249404b20" title="Returns the number of bytes read by the last Read() or ReadMsg() call (receive direction only)...">LastReadCount()</a>, <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a7c16b20282272c68acfe04107d430bf6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_socket_base.html">wxSocketBase</a>& wxSocketBase::ReadMsg </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> </td>
<td class="paramname"><em>nbytes</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Receive a message sent by <a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a>. </p>
<p>If the buffer passed to the function isn't big enough, the remaining bytes will be discarded. This function always waits for the buffer to be entirely filled, unless an error occurs.</p>
<p>Use <a class="el" href="classwx_socket_base.html#a0cfe7a2aaf5749041076b38249404b20" title="Returns the number of bytes read by the last Read() or ReadMsg() call (receive direction only)...">LastReadCount()</a> to verify the number of bytes actually read.</p>
<p>Use <a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a> to determine if the operation succeeded.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>Buffer where to put read data. </td></tr>
<tr><td class="paramname">nbytes</td><td>Size of the buffer.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a reference to the current object.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd><a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a> will behave as if the <b>wxSOCKET_WAITALL</b> flag was always set and it will always ignore the <b>wxSOCKET_NOWAIT</b> flag. The exact behaviour of <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a> depends on the <b>wxSOCKET_BLOCK</b> flag. For a detailed explanation, see <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a>. For thread safety, in case <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a> and <a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a> are called in different threads, it is a good idea to call SetFlags(wxSOCKET_WAITALL|wx_SOCKET_BLOCK) before the first calls to <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a> and <a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a> in different threads, as each of these functions will call <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a> which performs read/modify/write. By setting these flags before the multi-threading, it will ensure that they don't get reset by thread race conditions.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a>, <a class="el" href="classwx_socket_base.html#a4b3fa4395c33fd4f99956a5585e49b2e" title="Returns the last wxSocket error.">LastError()</a>, <a class="el" href="classwx_socket_base.html#a0cfe7a2aaf5749041076b38249404b20" title="Returns the number of bytes read by the last Read() or ReadMsg() call (receive direction only)...">LastReadCount()</a>, <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a>, <a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a386797430bfc9f568be388e7abf6c782"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxSocketBase::RestoreState </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Restore the previous state of the socket, as saved with <a class="el" href="classwx_socket_base.html#af227621ab1ee04542063fe91ea281e49" title="Save the current state of the socket in a stack.">SaveState()</a>. </p>
<p>Calls to <a class="el" href="classwx_socket_base.html#af227621ab1ee04542063fe91ea281e49" title="Save the current state of the socket in a stack.">SaveState()</a> and <a class="el" href="classwx_socket_base.html#a386797430bfc9f568be388e7abf6c782" title="Restore the previous state of the socket, as saved with SaveState().">RestoreState()</a> can be nested.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#af227621ab1ee04542063fe91ea281e49" title="Save the current state of the socket in a stack.">SaveState()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="af227621ab1ee04542063fe91ea281e49"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxSocketBase::SaveState </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Save the current state of the socket in a stack. </p>
<p>Socket state includes flags, as set with <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a>, event mask, as set with <a class="el" href="classwx_socket_base.html#a4a3883a253c29e0f0027d279c647dbe0" title="Specifies which socket events are to be sent to the event handler.">SetNotify()</a> and <a class="el" href="classwx_socket_base.html#acfaca539bd0fe0e9c0b1018c77e6701c" title="According to the notify value, this function enables or disables socket events.">Notify()</a>, user data, as set with <a class="el" href="classwx_socket_base.html#a5695e6dc7db8e4119caf3c81dcbc7306" title="Sets user-supplied client data for this socket.">SetClientData()</a>. Calls to SaveState and RestoreState can be nested.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#a386797430bfc9f568be388e7abf6c782" title="Restore the previous state of the socket, as saved with SaveState().">RestoreState()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a5695e6dc7db8e4119caf3c81dcbc7306"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxSocketBase::SetClientData </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>data</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets user-supplied client data for this socket. </p>
<p>All socket events will contain a pointer to this data, which can be retrieved with the <a class="el" href="classwx_socket_event.html#ad25a41eaa76521bef7c9d9a3d2bb0936" title="Gets the client data of the socket which generated this event, as set with wxSocketBase::SetClientDat...">wxSocketEvent::GetClientData()</a> function. </p>
</div>
</div>
<a class="anchor" id="a09819e56d36638fb6b45bf3dd7ea8742"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxSocketBase::SetEventHandler </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classwx_evt_handler.html">wxEvtHandler</a> & </td>
<td class="paramname"><em>handler</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>id</em> = <code>-1</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets an event handler to be called when a socket event occurs. </p>
<p>The handler will be called for those events for which notification is enabled with <a class="el" href="classwx_socket_base.html#a4a3883a253c29e0f0027d279c647dbe0" title="Specifies which socket events are to be sent to the event handler.">SetNotify()</a> and <a class="el" href="classwx_socket_base.html#acfaca539bd0fe0e9c0b1018c77e6701c" title="According to the notify value, this function enables or disables socket events.">Notify()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">handler</td><td>Specifies the event handler you want to use. </td></tr>
<tr><td class="paramname">id</td><td>The id of socket event.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#a4a3883a253c29e0f0027d279c647dbe0" title="Specifies which socket events are to be sent to the event handler.">SetNotify()</a>, <a class="el" href="classwx_socket_base.html#acfaca539bd0fe0e9c0b1018c77e6701c" title="According to the notify value, this function enables or disables socket events.">Notify()</a>, <a class="el" href="classwx_socket_event.html" title="This event class contains information about socket events.">wxSocketEvent</a>, <a class="el" href="classwx_evt_handler.html" title="A class that can handle events from the windowing system.">wxEvtHandler</a> </dd></dl>
</div>
</div>
<a class="anchor" id="aa11d1db40c87c8e06e3f9849a08abafc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxSocketBase::SetFlags </td>
<td>(</td>
<td class="paramtype">wxSocketFlags </td>
<td class="paramname"><em>flags</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Use SetFlags to customize IO operation for this socket. </p>
<p>The <em>flags</em> parameter may be a combination of flags ORed together. Notice that not all combinations of flags affecting the IO calls (<a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2" title="Read up to the given number of bytes from the socket.">Read()</a> and <a class="el" href="classwx_socket_base.html#a7676f1821d2e17db95de2438346355cd" title="Write up to the given number of bytes to the socket.">Write()</a>) make sense, e.g. <b>wxSOCKET_NOWAIT</b> can't be combined with <b>wxSOCKET_WAITALL</b> nor with <b>wxSOCKET_BLOCK</b>.</p>
<p>The following flags can be used: </p>
<div> </div><ul>
<li><span class="flag">wxSOCKET_NONE</span>:<div class="flagDesc"> Default mode: the socket will read some data in the IO calls and will process events to avoid blocking UI while waiting for the data to become available. </div></li>
<li><span class="flag">wxSOCKET_NOWAIT</span>:<div class="flagDesc"> Don't wait for the socket to become ready in IO calls, read as much data as is available – potentially 0 bytes – and return immediately. </div></li>
<li><span class="flag">wxSOCKET_WAITALL</span>:<div class="flagDesc"> Don't return before the entire amount of data specified in IO calls is read or written unless an error occurs. If this flag is not specified, the IO calls return as soon as any amount of data, even less than the total number of bytes, is processed. </div></li>
<li><span class="flag">wxSOCKET_BLOCK</span>:<div class="flagDesc"> Don't process the UI events while waiting for the socket to become ready. This means that UI will be unresponsive during socket IO. </div></li>
<li><span class="flag">wxSOCKET_REUSEADDR</span>:<div class="flagDesc"> Allows the use of an in-use port (wxServerSocket only). </div></li>
<li><span class="flag">wxSOCKET_BROADCAST</span>:<div class="flagDesc"> Switches the socket to broadcast mode. </div></li>
<li><span class="flag">wxSOCKET_NOBIND</span>:<div class="flagDesc"> Stops the socket from being bound to a specific adapter (normally used in conjunction with <b>wxSOCKET_BROADCAST</b>). </div></li>
</ul>
<p>For more information on socket events see <a class="el" href="socket_8h.html#wxSocketFlags">wxSocketFlags</a> . </p>
</div>
</div>
<a class="anchor" id="a18b26d4201f86daf64c881433c68a1b3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual bool wxSocketBase::SetLocal </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_i_p_v4address.html">wxIPV4address</a> & </td>
<td class="paramname"><em>local</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the local address and port to use. </p>
<p>This function must always be called for the server sockets but may also be called for client sockets, if it is, <b>bind()</b> is called before <b>connect()</b>. </p>
</div>
</div>
<a class="anchor" id="a4a3883a253c29e0f0027d279c647dbe0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxSocketBase::SetNotify </td>
<td>(</td>
<td class="paramtype"><a class="el" href="socket_8h.html#a2ec8996eecae7da1c5fa77c88a45a353">wxSocketEventFlags</a> </td>
<td class="paramname"><em>flags</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies which socket events are to be sent to the event handler. </p>
<p>The <em>flags</em> parameter may be combination of flags ORed together. The following flags can be used:</p>
<div> </div><ul>
<li><span class="flag">wxSOCKET_INPUT_FLAG</span>:<div class="flagDesc"> to receive <b>wxSOCKET_INPUT</b>. </div></li>
<li><span class="flag">wxSOCKET_OUTPUT_FLAG</span>:<div class="flagDesc"> to receive <b>wxSOCKET_OUTPUT</b>. </div></li>
<li><span class="flag">wxSOCKET_CONNECTION_FLAG</span>:<div class="flagDesc"> to receive <b>wxSOCKET_CONNECTION</b>. </div></li>
<li><span class="flag">wxSOCKET_LOST_FLAG</span>:<div class="flagDesc"> to receive <b>wxSOCKET_LOST</b>. </div></li>
</ul>
<p>For example:</p>
<div class="fragment"><div class="line">sock.SetNotify(wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG);</div>
<div class="line">sock.Notify(<span class="keyword">true</span>);</div>
</div><!-- fragment --><p>In this example, the user will be notified about incoming socket data and whenever the connection is closed.</p>
<p>For more information on socket events see <a class="el" href="socket_8h.html#wxSocketEventFlags">wxSocketEventFlags</a> . </p>
</div>
</div>
<a class="anchor" id="ac24247e3f866154825c14de46a911e50"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxSocketBase::SetTimeout </td>
<td>(</td>
<td class="paramtype">long </td>
<td class="paramname"><em>seconds</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the default socket timeout in seconds. </p>
<p>This timeout applies to all IO calls, and also to the <a class="el" href="classwx_socket_base.html#ae46d0dea0ec25af581ba3119cca4bd7e" title="Wait for any socket event.">Wait()</a> family of functions if you don't specify a wait interval. Initially, the default timeout is 10 minutes. </p>
</div>
</div>
<a class="anchor" id="acfa7398ce7fac6e8db20caeb3a09b10e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void wxSocketBase::Shutdown </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Shut down the sockets. </p>
<p>This function undoes the call to <a class="el" href="classwx_socket_base.html#a4c4c4cc8e1fcd824ef621b0f3d17b29f" title="Perform the initialization needed in order to use the sockets.">Initialize()</a> and must be called after every successful call to <a class="el" href="classwx_socket_base.html#a4c4c4cc8e1fcd824ef621b0f3d17b29f" title="Perform the initialization needed in order to use the sockets.">Initialize()</a>.</p>
<p>This function should only be called from the main thread, just as <a class="el" href="classwx_socket_base.html#a4c4c4cc8e1fcd824ef621b0f3d17b29f" title="Perform the initialization needed in order to use the sockets.">Initialize()</a>. </p>
</div>
</div>
<a class="anchor" id="a90d2aea95b10c68eee2656860d90e23e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxSocketBase::ShutdownOutput </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Shuts down the writing end of the socket. </p>
<p>This function simply calls the standard shutdown() function on the underlying socket, indicating that nothing will be written to this socket any more. </p>
</div>
</div>
<a class="anchor" id="a8fd912526830f7b079ac28677424d40a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_socket_base.html">wxSocketBase</a>& wxSocketBase::Unread </td>
<td>(</td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> </td>
<td class="paramname"><em>nbytes</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Put the specified data into the input queue. </p>
<p>The data in the buffer will be returned by the next call to <a class="el" href="classwx_socket_base.html#aa75b3c2dd051a012cfbd0596d95f80c2" title="Read up to the given number of bytes from the socket.">Read()</a>.</p>
<p>This function is not affected by wxSocket flags.</p>
<p>If you use <a class="el" href="classwx_socket_base.html#a5b0cfbb970153b563c7134c1e8ba8319" title="Returns the number of bytes read or written by the last IO call.">LastCount()</a>, it will always return <em>nbytes</em>.</p>
<p>If you use <a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a>, it will always return <span class="literal">false</span>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>Buffer to be unread. </td></tr>
<tr><td class="paramname">nbytes</td><td>Number of bytes.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a reference to the current object.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a>, <a class="el" href="classwx_socket_base.html#a5b0cfbb970153b563c7134c1e8ba8319" title="Returns the number of bytes read or written by the last IO call.">LastCount()</a>, <a class="el" href="classwx_socket_base.html#a4b3fa4395c33fd4f99956a5585e49b2e" title="Returns the last wxSocket error.">LastError()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ae46d0dea0ec25af581ba3119cca4bd7e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxSocketBase::Wait </td>
<td>(</td>
<td class="paramtype">long </td>
<td class="paramname"><em>seconds</em> = <code>-1</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">long </td>
<td class="paramname"><em>millisecond</em> = <code>0</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Wait for any socket event. </p>
<p>Possible socket events are: </p>
<ul>
<li>The socket becomes readable. </li>
<li>The socket becomes writable. </li>
<li>An ongoing connection request has completed (<a class="el" href="classwx_socket_client.html">wxSocketClient</a> only) </li>
<li>An incoming connection request has arrived (<a class="el" href="classwx_socket_server.html">wxSocketServer</a> only) </li>
<li>The connection has been closed.</li>
</ul>
<p>Note that it is recommended to use the individual <b>WaitForXXX()</b> functions to wait for the required condition, instead of this one.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">seconds</td><td>Number of seconds to wait. If -1, it will wait for the default timeout, as set with <a class="el" href="classwx_socket_base.html#ac24247e3f866154825c14de46a911e50" title="Set the default socket timeout in seconds.">SetTimeout()</a>. </td></tr>
<tr><td class="paramname">millisecond</td><td>Number of milliseconds to wait.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><span class="literal">true</span> when any of the above conditions is satisfied or <span class="literal">false</span> if the timeout was reached.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#a89897c3ea99e6e3d8d5daf8e26596bc3" title="Use this function to interrupt any wait operation currently in progress.">InterruptWait()</a>, <a class="el" href="classwx_socket_server.html#a3e0998c069bf8b3ef447167faf00ebae" title="Wait for an incoming connection.">wxSocketServer::WaitForAccept()</a>, <a class="el" href="classwx_socket_base.html#a80e8a0feaed33843aa7972c02909106c" title="Wait until the connection is lost.">WaitForLost()</a>, <a class="el" href="classwx_socket_base.html#aab8fdd558f149d70ed265dad0f12e9f8" title="Wait until the socket is readable.">WaitForRead()</a>, <a class="el" href="classwx_socket_base.html#abda804254aa40c9f8ae363dbc5ebc1f2" title="Wait until the socket becomes writable.">WaitForWrite()</a>, <a class="el" href="classwx_socket_client.html#a83c92e8c27a72c3610c9eb0b60e92d74" title="Wait until a connection request completes, or until the specified timeout elapses.">wxSocketClient::WaitOnConnect()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a80e8a0feaed33843aa7972c02909106c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxSocketBase::WaitForLost </td>
<td>(</td>
<td class="paramtype">long </td>
<td class="paramname"><em>seconds</em> = <code>-1</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">long </td>
<td class="paramname"><em>millisecond</em> = <code>0</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Wait until the connection is lost. </p>
<p>This may happen if the peer gracefully closes the connection or if the connection breaks.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">seconds</td><td>Number of seconds to wait. If -1, it will wait for the default timeout, as set with <a class="el" href="classwx_socket_base.html#ac24247e3f866154825c14de46a911e50" title="Set the default socket timeout in seconds.">SetTimeout()</a>. </td></tr>
<tr><td class="paramname">millisecond</td><td>Number of milliseconds to wait.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns <span class="literal">true</span> if the connection was lost, <span class="literal">false</span> if the timeout was reached.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#a89897c3ea99e6e3d8d5daf8e26596bc3" title="Use this function to interrupt any wait operation currently in progress.">InterruptWait()</a>, <a class="el" href="classwx_socket_base.html#ae46d0dea0ec25af581ba3119cca4bd7e" title="Wait for any socket event.">Wait()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="aab8fdd558f149d70ed265dad0f12e9f8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxSocketBase::WaitForRead </td>
<td>(</td>
<td class="paramtype">long </td>
<td class="paramname"><em>seconds</em> = <code>-1</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">long </td>
<td class="paramname"><em>millisecond</em> = <code>0</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Wait until the socket is readable. </p>
<p>This might mean that queued data is available for reading or, for streamed sockets, that the connection has been closed, so that a read operation will complete immediately without blocking (unless the <b>wxSOCKET_WAITALL</b> flag is set, in which case the operation might still block).</p>
<p>Notice that this function should not be called if there is already data available for reading on the socket.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">seconds</td><td>Number of seconds to wait. If -1, it will wait for the default timeout, as set with <a class="el" href="classwx_socket_base.html#ac24247e3f866154825c14de46a911e50" title="Set the default socket timeout in seconds.">SetTimeout()</a>. </td></tr>
<tr><td class="paramname">millisecond</td><td>Number of milliseconds to wait.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns <span class="literal">true</span> if the socket becomes readable, <span class="literal">false</span> on timeout.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#a89897c3ea99e6e3d8d5daf8e26596bc3" title="Use this function to interrupt any wait operation currently in progress.">InterruptWait()</a>, <a class="el" href="classwx_socket_base.html#ae46d0dea0ec25af581ba3119cca4bd7e" title="Wait for any socket event.">Wait()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="abda804254aa40c9f8ae363dbc5ebc1f2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxSocketBase::WaitForWrite </td>
<td>(</td>
<td class="paramtype">long </td>
<td class="paramname"><em>seconds</em> = <code>-1</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">long </td>
<td class="paramname"><em>millisecond</em> = <code>0</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Wait until the socket becomes writable. </p>
<p>This might mean that the socket is ready to send new data, or for streamed sockets, that the connection has been closed, so that a write operation is guaranteed to complete immediately (unless the <b>wxSOCKET_WAITALL</b> flag is set, in which case the operation might still block).</p>
<p>Notice that this function should not be called if the socket is already writable.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">seconds</td><td>Number of seconds to wait. If -1, it will wait for the default timeout, as set with <a class="el" href="classwx_socket_base.html#ac24247e3f866154825c14de46a911e50" title="Set the default socket timeout in seconds.">SetTimeout()</a>. </td></tr>
<tr><td class="paramname">millisecond</td><td>Number of milliseconds to wait.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns <span class="literal">true</span> if the socket becomes writable, <span class="literal">false</span> on timeout.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#a89897c3ea99e6e3d8d5daf8e26596bc3" title="Use this function to interrupt any wait operation currently in progress.">InterruptWait()</a>, <a class="el" href="classwx_socket_base.html#ae46d0dea0ec25af581ba3119cca4bd7e" title="Wait for any socket event.">Wait()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a7676f1821d2e17db95de2438346355cd"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_socket_base.html">wxSocketBase</a>& wxSocketBase::Write </td>
<td>(</td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> </td>
<td class="paramname"><em>nbytes</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Write up to the given number of bytes to the socket. </p>
<p>Use <a class="el" href="classwx_socket_base.html#a0af60002ca2775490ad8bcd937591829" title="Returns the number of bytes written by the last Write() or WriteMsg() call (transmit direction only)...">LastWriteCount()</a> to verify the number of bytes actually written.</p>
<p>Use <a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a> to determine if the operation succeeded.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>Buffer with the data to be sent. </td></tr>
<tr><td class="paramname">nbytes</td><td>Number of bytes.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a reference to the current object.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd></dd></dl>
<p>The exact behaviour of <a class="el" href="classwx_socket_base.html#a7676f1821d2e17db95de2438346355cd" title="Write up to the given number of bytes to the socket.">Write()</a> depends on the combination of flags being used. For a detailed explanation, see <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a>, <a class="el" href="classwx_socket_base.html#a4b3fa4395c33fd4f99956a5585e49b2e" title="Returns the last wxSocket error.">LastError()</a>, <a class="el" href="classwx_socket_base.html#a0af60002ca2775490ad8bcd937591829" title="Returns the number of bytes written by the last Write() or WriteMsg() call (transmit direction only)...">LastWriteCount()</a>, <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a91abca66c1d5bf4237aa87b0e796464b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_socket_base.html">wxSocketBase</a>& wxSocketBase::WriteMsg </td>
<td>(</td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="defs_8h.html#afdb12e5345c3fae4b537e813df9f02a3">wxUint32</a> </td>
<td class="paramname"><em>nbytes</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sends a buffer which can be read using <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a>. </p>
<p><a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a> sends a short header before the data so that <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a> knows how much data should be actually read.</p>
<p>This function always waits for the entire buffer to be sent, unless an error occurs.</p>
<p>Use <a class="el" href="classwx_socket_base.html#a0af60002ca2775490ad8bcd937591829" title="Returns the number of bytes written by the last Write() or WriteMsg() call (transmit direction only)...">LastWriteCount()</a> to verify the number of bytes actually written.</p>
<p>Use <a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a> to determine if the operation succeeded.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>Buffer with the data to be sent. </td></tr>
<tr><td class="paramname">nbytes</td><td>Number of bytes to send.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a reference to the current object.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd></dd></dl>
<p><a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a> will behave as if the <b>wxSOCKET_WAITALL</b> flag was always set and it will always ignore the <b>wxSOCKET_NOWAIT</b> flag. The exact behaviour of <a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a> depends on the <b>wxSOCKET_BLOCK</b> flag. For a detailed explanation, see <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a>. For thread safety, in case <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a> and <a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a> are called in different threads, it is a good idea to call </p>
<div class="fragment"><div class="line"><a class="code" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags</a>(<a class="code" href="socket_8h.html#a1fb9092bcdeada2d206bdc74afbbe122aea93cf511bb913dfc17571dd29a2de22" title="Wait for all required data to be read/written unless an error occurs.">wxSOCKET_WAITALL</a>|wx_SOCKET_BLOCK) </div>
</div><!-- fragment --><p> before the first calls to <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a> and <a class="el" href="classwx_socket_base.html#a91abca66c1d5bf4237aa87b0e796464b" title="Sends a buffer which can be read using ReadMsg().">WriteMsg()</a> in different threads, as each of these functions calls <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a> which performs read/modify/write. By setting these flags before the multi-threading, it will ensure that they don't get reset by thread race conditions.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_socket_base.html#a1a70bf5e24ccf3a6171ba07c06f8dac9" title="Returns true if an error occurred in the last IO operation.">Error()</a>, <a class="el" href="classwx_socket_base.html#a4b3fa4395c33fd4f99956a5585e49b2e" title="Returns the last wxSocket error.">LastError()</a>, <a class="el" href="classwx_socket_base.html#a0af60002ca2775490ad8bcd937591829" title="Returns the number of bytes written by the last Write() or WriteMsg() call (transmit direction only)...">LastWriteCount()</a>, <a class="el" href="classwx_socket_base.html#aa11d1db40c87c8e06e3f9849a08abafc" title="Use SetFlags to customize IO operation for this socket.">SetFlags()</a>, <a class="el" href="classwx_socket_base.html#a7c16b20282272c68acfe04107d430bf6" title="Receive a message sent by WriteMsg().">ReadMsg()</a> </dd></dl>
</div>
</div>
</div><!-- contents -->
<address class="footer">
<small>
Generated on Thu Nov 27 2014 13:46:58 for wxWidgets by <a href="http://www.doxygen.org/index.html" target="_new">Doxygen</a> 1.8.2
</small>
</address>
<script src="wxwidgets.js" type="text/javascript"></script>
</div><!-- #page_container -->
</body>
</html>
|