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 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<fpdoc-descriptions>
<package name="fcl">
<!--
====================================================================
simpleipc
====================================================================
-->
<module name="simpleipc">
<short>Simple one-way IPC protocol</short>
<descr>
<p>
The <file>SimpleIPC</file> unit provides classes to implement a simple,
one-way IPC mechanism using string messages. It provides a
<link id="TSimpleIPCServer"/> component for the server, and a <link
id="TSimpleIPCClient"/> component for the client. The components are
cross-platform, and should work both on Windows and UNIX-like systems.
</p>
<p>
The Unix implementation of the SimpleIPC unit uses file-based sockets.
It will attempt to clean up any registered server socket files that were
not removed cleanly.
</p>
<p>
It does this in the unit finalization code. It does not install a signal
handler by itself, that is the task of the programmer. But program crashes
(access violations and such) that are handled by the RTL will be handled
gracefully.
</p>
<p>
This also means that if the process is killed with the KILL signal,
it has no chance of removing the files (KILL signals cannot be caught),
in which case socket files may remain in the file system. However,
the client code attempts to cater for this and will remove the stale sockets
if it detects them.
</p>
<p>
Under Windows, the communication is done through <var>WM_COPYDATA</var> messages.
Starting from Windows Vista it is forbidden to send messages between service
applications and desktop applications, so a SimpleIPC client in a desktop
application cannot connect to a SimpleIPC server in a service application
and vice versa.
</p>
</descr>
<!-- unresolved type reference Visibility: default -->
<element name="Classes">
<short><var>TComponent</var> definition.</short>
</element>
<!-- unresolved type reference Visibility: default -->
<element name="SysUtils">
<short>Exception support and formatting support</short>
</element>
<!-- constant Visibility: default -->
<element name="MsgVersion">
<short>Current version of the messaging protocol</short>
</element>
<!-- constant Visibility: default -->
<element name="mtUnknown">
<short>Unknown message type</short>
</element>
<!-- constant Visibility: default -->
<element name="mtString">
<short>String message type</short>
</element>
<!-- alias type Visibility: default -->
<element name="TMessageType">
<short>For backwards compatibility</short>
<descr>
<var>TMessageType</var> is provided for backward compatibility with earlier
versions of the <file>simpleipc</file> unit.
</descr>
</element>
<!-- record type Visibility: default -->
<element name="TMsgHeader">
<short>Message header record</short>
<descr>
<var>TMsgHeader</var> is used internally by the IPC client and server
components to transmit data. The <var>Version</var> field denotes the
protocol version. The <var>MsgType</var> field denotes the type of data
(<var>mtString</var> for string messages), and <var>MsgLen</var> is the
length of the message which will follow.
</descr>
<seealso>
<link id="TSimpleIPCServer"/>
<link id="TSimpleIPCClient"/>
</seealso>
</element>
<!-- variable Visibility: default -->
<element name="TMsgHeader.Version">
<short>Version number</short>
</element>
<!-- variable Visibility: default -->
<element name="TMsgHeader.MsgType">
<short>Message data type</short>
</element>
<!-- variable Visibility: default -->
<element name="TMsgHeader.MsgLen">
<short>Message length</short>
</element>
<!--
********************************************************************
#fcl.simpleipc.TIPCServerComm
********************************************************************
-->
<!-- object Visibility: default -->
<element name="TIPCServerComm">
<short>Internal message communication component</short>
<descr>
<p>
<var>TIPCServerComm</var> is an abstract component which implements the
server-side communication protocol. The behaviour expected of this class
must be implemented in a platform-dependent descendent class.
</p>
<p>
The <link id="TSimpleIPCServer"/> class does not implement the messaging protocol
by itself. Instead, it creates an instance of a (platform dependent)
descendent of <var>TIPCServerComm</var> which handles the internals of
the communication protocol.
</p>
<p>
The client side of the messaging protocol is handled by the
<link id="TIPCClientComm"/> component. The descendent components must always be
implemented in pairs.
</p>
</descr>
<seealso>
<link id="TSimpleIPCServer"/>
<link id="TIPCClientComm"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TIPCServerComm.Create">
<short>Create a new instance of the communication handler</short>
<descr>
<var>Create</var> initializes a new instance of the communication handler.
It simply saves the <var>AOwner</var> parameter in the <link
id="TIPCServerComm.Owner">Owner</link> property.
</descr>
<seealso>
<link id="TIPCServerComm.Owner">Owner</link>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TIPCServerComm.Create.AOwner">
<short><var>TSimpleIPCServer</var> instance for which to handle transport</short>
</element>
<!-- property Visibility: public -->
<element name="TIPCServerComm.Owner">
<short><var>TSimpleIPCServer</var> instance for which to handle transport</short>
<descr>
<var>Owner</var> refers to the <link id="TSimpleIPCServer"/> instance for
which this instance of <var>TSimpleIPCServer</var> handles the transport. It
is specified when the <var>TIPCServerComm</var> is created.
</descr>
<seealso>
<link id="TSimpleIPCServer"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TIPCServerComm.StartServer">
<short>Start the server-side of the communication channel</short>
<descr>
<p>
<var>StartServer</var> sets up the server-side of the communication channel.
After <var>StartServer</var> was called, a client can connect to the
communication channel, and send messages to the server.
</p>
<p>
It is called when the <link id="TSimpleIPC.Active"/> property of the <link
id="TSimpleIPCServer"/> instance is set to <var>True</var>.
</p>
<p>
If <var>Threaded</var> is <var>True</var> then a background thread is
started which will check for new messages periodically (see also <link
id="TSimpleIPCServer.ThreadTimeOut"/>). The arrival of new messages can be
acted upon with <link id="TSimpleIPCServer.OnMessageQueued"/>.
</p>
</descr>
<errors>
In case of an error, an <link id="EIPCError"/> exception is raised.
</errors>
<seealso>
<link id="TSimpleIPCServer"/>
<link id="TSimpleIPC.Active"/>
<link id="TSimpleIPCServer.OnMessageQueued"/>
<link id="TSimpleIPCServer.ThreadTimeOut"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TIPCServerComm.StopServer">
<short>Stop the server side of the communication channel.</short>
<descr>
<p>
<var>StopServer</var> closes down the server-side of the communication
channel. After <var>StartServer</var> was called, a client can no longer
connect to the communication channel, or even send messages to the server if
it was previously connected (i.e. it will be disconnected).
</p>
<p>
It is called when the <link id="TSimpleIPC.Active"/> property of the <link
id="TSimpleIPCServer"/> instance is set to <var>False</var>.
</p>
</descr>
<errors>
In case of an error, an <link id="EIPCError"/> exception is raised.
</errors>
<seealso>
<link id="TSimpleIPCServer"/>
<link id="TSimpleIPC.Active"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TIPCServerComm.PeekMessage">
<short>See if a message is available.</short>
<descr>
<p>
<var>PeekMessage</var> can be used to see if a message is available: it
returns <var>True</var> if a message is available. It will wait maximum
<var>TimeOut</var> milliseconds for a message to arrive. If no message was
available after this time, it will return <var>False</var>.
</p>
<p>
If a message was available, it can be read with the
<link id="TIPCServerComm.ReadMessage">ReadMessage</link> call.
</p>
</descr>
<seealso>
<link id="TIPCServerComm.ReadMessage">ReadMessage</link>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="TIPCServerComm.PeekMessage.Result">
<short><var>True</var> if a message was available.</short>
</element>
<!-- argument Visibility: default -->
<element name="TIPCServerComm.PeekMessage.TimeOut">
<short>Number of milliseconds to wait for a message.</short>
</element>
<!-- function Visibility: public -->
<element name="TIPCServerComm.InstanceID">
<short>Unique identifier for the communication channel.</short>
<descr>
<var>InstanceID</var> returns a textual representation which uniquely
identifies the communication channel on the server. The value is system
dependent, and should be usable by the client-side to establish a
communication channel with this instance.
</descr>
</element>
<!-- function result Visibility: default -->
<element name="TIPCServerComm.GetInstanceID.Result">
<short>Unique identification of the channel</short>
</element>
<!-- procedure Visibility: public -->
<element name="TIPCServerComm.ReadMessage">
<short>Read message from the channel.</short>
<descr>
<p>
<var>ReadMessage</var> reads the message for the channel, and stores the
information in the data structures in the <var>Owner</var> class.
</p>
<p>
<var>ReadMessage</var> is a blocking call: if no message is available, the
program will wait till a message arrives. Use <link
id="TIPCServerComm.PeekMessage">PeekMessage</link> to see if a message is
available.
</p>
</descr>
<seealso>
<link id="TSimpleIPCServer"/>
</seealso>
</element>
<!-- "class of" type Visibility: default -->
<element name="TIPCServerCommClass">
<short>Class reference for <link id="#fcl.simpleipc.TIPCServerComm">TIPCServerComm</link></short>
<descr>
<var>TIPCServerCommClass</var> is used by <link id="TSimpleIPCServer"/>
to decide which kind of communication channel to set up.
</descr>
<seealso>
<link id="TSimpleIPCServer"/>
<link id="TIPCServerComm"/>
</seealso>
</element>
<!--
********************************************************************
#fcl.simpleipc.TSimpleIPC
********************************************************************
-->
<!-- object Visibility: default -->
<element name="TSimpleIPC">
<short>Ancestor for client/server simple IPC classes</short>
<descr>
<var>TSimpleIPC</var> is the common ancestor for the <link
id="TSimpleIPCServer"/> and <link id="TSimpleIPCClient"/> classes.
It implements some common properties between client and server.
</descr>
<seealso>
<link id="TSimpleIPCServer"/>
<link id="TSimpleIPCClient"/>
</seealso>
</element>
<!-- property Visibility: published -->
<element name="TSimpleIPC.Active">
<short>Communication channel active</short>
<descr>
<var>Active</var> can be set to <var>True</var> to set up the client or
server end of the communication channel. For the server this means that the
server end is set up, for the client it means that the client tries to
connect to the server with <link id="TSimpleIPC.ServerID">ServerID</link>
identification.
</descr>
<seealso>
<link id="TSimpleIPC.ServerID">ServerID</link>
</seealso>
</element>
<!-- property Visibility: published -->
<element name="TSimpleIPC.ServerID">
<short>Unique server identification</short>
<descr>
<var>ServerID</var> is the unique server identification: on the server, it
determines how the server channel is set up, on the client it determines the
server with which to connect.
</descr>
<seealso>
<link id="TSimpleIPC.Active">Active</link>
</seealso>
</element>
<!--
********************************************************************
#fcl.simpleipc.TSimpleIPCServer
********************************************************************
-->
<!-- object Visibility: default -->
<element name="TSimpleIPCServer">
<short>Simple IPC server component</short>
<descr>
<p>
<var>TSimpleIPCServer</var> is the server side of the simple IPC
communication protocol. The server program should create a
<var>TSimpleIPCServer</var> instance, set its <link
id="TSimpleIPC.ServerID">ServerID</link> property to a unique name for the
system, and then set the <link id="TSimpleIPC.ServerID">Active</link>
property to <var>True</var> (or call <link id="TSimpleIPCServer.StartServer">StartServer</link>).
</p>
<p>
After the server was started, it can check for availability of messages with
the <link id="TSimpleIPCServer.PeekMessage">PeekMessage</link> call, and
read the message with <link id="TSimpleIPCServer.ReadMessage">ReadMessage</link>.
</p>
</descr>
<seealso>
<link id="TSimpleIPCClient"/>
<link id="TSimpleIPC"/>
<link id="TIPCServerComm"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TSimpleIPCServer.Create">
<short>Create a new instance of <var>TSimpleIPCServer</var></short>
<descr>
<var>Create</var> instantiates a new instance of the
<var>TSimpleIPCServer</var> class. It initializes the data structures needed
to handle the server side of the communication.
</descr>
<seealso>
<link id="TSimpleIPCServer.Destroy">Destroy</link>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCServer.Create.AOwner">
<short>Owner of the <var>TSimpleIPCServer</var> instance.</short>
</element>
<!-- destructor Visibility: public -->
<element name="TSimpleIPCServer.Destroy">
<short>Remove the <var>TSimpleIPCServer</var> instance from memory</short>
<descr>
<p>
<var>Destroy</var> stops the server, cleans up the internal data structures maintained by
<var>TSimpleIPCServer</var> and then calls the inherited <var>Destroy</var>,
which will remove the instance from memory.
</p>
<p>
Never call <var>Destroy</var> directly, use the <var>Free</var> method
instead or the <var>FreeAndNil</var> procedure in <file>SysUtils</file>.
</p>
</descr>
<seealso>
<link id="TSimpleIPCServer.Create">Create</link>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TSimpleIPCServer.StartServer">
<short>Start the server</short>
<descr>
<p>
<var>StartServer</var> starts the server side of the communication channel.
It is called automatically when the <var>Active</var> property is set to
<var>True</var>. It creates the internal communication object (a <link
id="TIPCServerComm"/> descendent) and activates the communication channel.
</p>
<p>
The <var>aThreaded</var> property can be used to force or disable threaded mode:
in threaded mode, a thread is started that automatically checks for new messages and puts them on a queue.
If the argument is not specified, then the property <link id="TSimpleIPCServer.Threaded"/> is examined to know
whether to start in threaded mode or not.
</p>
<p>
After this method was called, clients can connect and send messages.
</p>
<p>
Prior to calling this method, the <link id="TSimpleIPC.ServerID">ServerID</link>
property must be set.
</p>
</descr>
<errors>
If an error occurs a <link id="EIPCError"/> exception may be raised.
</errors>
<seealso>
<link id="TIPCServerComm"/>
<link id="TSimpleIPC.Active">Active</link>
<link id="TSimpleIPC.ServerID">ServerID</link>
<link id="TSimpleIPCServer.StopServer">StopServer</link>
<link id="TSimpleIPCServer.Threaded"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TSimpleIPCServer.StopServer">
<short>Stop the server</short>
<descr>
<p>
<var>StopServer</var> stops the server side of the communication channel.
It is called automatically when the <var>Active</var> property is set to
<var>False</var>. It deactivates the communication channel and frees
the internal communication object (a <link id="TIPCServerComm"/>
descendent).
</p>
<p>
</p>
</descr>
<seealso>
<link id="TIPCServerComm"/>
<link id="TSimpleIPC.Active">Active</link>
<link id="TSimpleIPC.ServerID">ServerID</link>
<link id="TSimpleIPCServer.StartServer">StartServer</link>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TSimpleIPCServer.PeekMessage">
<short>Check if a client message is available.</short>
<descr>
<p>
<var>PeekMessage</var> checks if a message from a client is available. It
will return <var>True</var> if a message is available. The call will wait
for <var>TimeOut</var> milliseconds for a message to arrive: if after
<var>TimeOut</var> milliseconds, no message is available, the function will
return <var>False</var>.
</p>
<p>
If <var>DoReadMessage</var> is <var>True</var> then <var>PeekMessage</var>
will read the message. If it is <var>False</var>, it does not read the
message. The message should then be read manually
with <link id="TSimpleIPCServer.ReadMessage">ReadMessage</link>.
</p>
</descr>
<seealso>
<link id="TSimpleIPCServer.ReadMessage">ReadMessage</link>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="TSimpleIPCServer.PeekMessage.Result">
<short><var>True</var> if a client message is available.</short>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCServer.PeekMessage.TimeOut">
<short>Number of milliseconds to wait for a message.</short>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCServer.PeekMessage.DoReadMessage">
<short>Should the message be read or not ?</short>
</element>
<!-- property Visibility: public -->
<element name="TSimpleIPCServer.StringMessage">
<short>Last message as a string.</short>
<descr>
<p>
<var>StringMessage</var> is the content of the last message as a string.
</p>
<p>
This property will contain valid data only after a successful call to
<link id="TSimpleIPCServer.ReadMessage">ReadMessage</link>.
</p>
</descr>
<seealso>
<link id="TSimpleIPCServer.GetMessageData">GetMessageData</link>.
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TSimpleIPCServer.GetMessageData">
<short>Read the data of the last message in a stream</short>
<descr>
<p>
<var>GetMessageData</var> reads the data of the last message from
<link id="TSimpleIPCServer.MsgData"/> and stores it in stream
<var>Stream</var>. If no data was available, the stream will be cleared.
</p>
<p>
This function will return valid data only after a successful call to
<link id="TSimpleIPCServer.ReadMessage">ReadMessage</link>. It will also not
clear the data buffer.
</p>
</descr>
<seealso>
<link id="TSimpleIPCServer.StringMessage">StringMessage</link>
<link id="TSimpleIPCServer.MsgData">MsgData</link>
<link id="TSimpleIPCServer.MsgType">MsgType</link>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCServer.GetMessageData.Stream">
<short>Stream to store message data in</short>
</element>
<!-- property Visibility: public -->
<element name="TSimpleIPCServer.MsgType">
<short>Last message type</short>
<descr>
<p>
<var>MsgType</var> contains the message type of the last message.
</p>
<p>
This property will contain valid data only after a successful call to
<link id="TSimpleIPCServer.ReadMessage">ReadMessage</link>.
</p>
</descr>
<seealso>
<link id="TSimpleIPCServer.ReadMessage">ReadMessage</link>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TSimpleIPCServer.MsgData">
<short>Last message data</short>
<descr>
<p>
<var>MsgData</var> contains the actual data from the last read message.
If the data is a string, then <link id="TSimpleIPCServer.StringMessage">StringMessage</link> is better suited to
read the data.
</p>
<p>
This property will contain valid data only after a successful call to
<link id="TSimpleIPCServer.ReadMessage">ReadMessage</link>.
</p>
</descr>
<seealso>
<link id="TSimpleIPCServer.StringMessage">StringMessage</link>
<link id="TSimpleIPCServer.ReadMessage">ReadMessage</link>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TSimpleIPCServer.InstanceID">
<short>Instance ID</short>
<descr>
<var>InstanceID</var> is the unique identifier for this server
communication channel endpoint, and will be appended to the
<link id="TSimpleIPC.ServerID">ServerID</link> property
to form the unique server endpoint which a client should use.
</descr>
<seealso>
<link id="TSimpleIPC.ServerID">ServerID</link>
<link id="TSimpleIPCServer.Global">Global</link>
</seealso>
</element>
<!-- property Visibility: published -->
<element name="TSimpleIPCServer.Global">
<short>Is the server reachable to all users or not</short>
<descr>
<var>Global</var> indicates whether the server is reachable to all users
(<var>True</var>) or if it is private to the current process (<var>False</var>).
In the latter case, the unique channel endpoint identification may change:
a unique identification of the current process is appended to the
<var>ServerID</var> name.
</descr>
<seealso>
<link id="TSimpleIPC.ServerID">ServerID</link>
<link id="TSimpleIPCServer.InstanceID">InstanceID</link>
</seealso>
</element>
<!-- property Visibility: published -->
<element name="TSimpleIPCServer.OnMessage">
<short>Event triggered when a message arrives</short>
<descr>
<var>OnMessage</var> is called by <link
id="TSimpleIPCServer.ReadMessage">ReadMessage</link> when a message has been
read. The actual message data can be retrieved with one of the
<link id="TSimpleIPCServer.StringMessage">StringMessage</link>,
<link id="TSimpleIPCServer.MsgData">MsgData</link> or
<link id="TSimpleIPCServer.MsgType">MsgType</link> properties.
</descr>
<seealso>
<link id="TSimpleIPCServer.StringMessage">StringMessage</link>
<link id="TSimpleIPCServer.MsgData">MsgData</link>
<link id="TSimpleIPCServer.MsgType">MsgType</link>
</seealso>
</element>
<!--
********************************************************************
#fcl.simpleipc.TIPCClientComm
********************************************************************
-->
<!-- object Visibility: default -->
<element name="TIPCClientComm">
<short>Internal client-side communication protocol</short>
<descr>
<p>
<var>TIPCClientComm</var> is an abstract component which implements the
client-side communication protocol. The behaviour expected of this class
must be implemented in a platform-dependent descendent class.
</p>
<p>
The <link id="TSimpleIPCClient"/> class does not implement the messaging protocol
by itself. Instead, it creates an instance of a (platform dependent)
descendent of <var>TIPCClientComm</var> which handles the internals of
the communication protocol.
</p>
<p>
The server side of the messaging protocol is handled by the
<link id="TIPCServerComm"/> component. The descendent components must always
be implemented in pairs.
</p>
</descr>
<seealso>
<link id="TSimpleIPCClient"/>
<link id="TIPCServerComm"/>
<link id="TSimpleIPCServer"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TIPCClientComm.Create">
<short>Create a new instance of the <var>TIPCClientComm</var></short>
<descr>
<var>Create</var> instantiates a new instance of the
<var>TIPCClientComm</var> class, and stores the <var>AOwner</var> reference
to the <link id="TSimpleIPCClient"/> instance for which it will handle
communication. It can be retrieved later using the <link id="TIPCClientComm.Owner">Owner</link> property.
</descr>
<seealso>
<link id="TIPCClientComm.Owner">Owner</link>
<link id="TSimpleIPCClient"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TIPCClientComm.Create.AOwner">
<short><var>TSimpleIPCClient</var> instance for which communication must be
handled.</short>
</element>
<!-- property Visibility: public -->
<element name="TIPCClientComm.Owner">
<short><var>TSimpleIPCClient</var> instance for which communication must be
handled.</short>
<descr>
<var>Owner</var> is the <link id="TSimpleIPCClient"/> instance for which the
communication must be handled. It cannot be changed, and must be specified
when the <var>TIPCClientComm</var> instance is created.
</descr>
<seealso>
<link id="TSimpleIPCClient"/>
<link id="TIPCClientComm.Create"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TIPCClientComm.Connect">
<short>Connect to the server</short>
<descr>
<p>
<var>Connect</var> must establish a communication channel with the server.
The server endpoint must be constructed from the <link
id="TSimpleIPC.ServerID">ServerID</link> and <link
id="TSimpleIPCClient.ServerInstance">ServerInstance</link> properties of the owning <link
id="TSimpleIPCClient"/> instance.
</p>
<p>
<var>Connect</var> is called by the <link id="TSimpleIPCClient.Connect"/> call
or when the <link id="TSimpleIPC.Active">Active</link> property is set to
<var>True</var>
</p>
<p>
Messages can be sent only after <var>Connect</var> was called successfully.
</p>
</descr>
<errors>
If the connection setup fails, or the connection was already set up, then an exception may be raised.
</errors>
<seealso>
<link id="TSimpleIPCClient.Connect"/>
<link id="TSimpleIPC.Active">Active</link>
<link id="TIPCClientComm.Disconnect">Disconnect</link>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TIPCClientComm.Disconnect">
<short>Disconnect from the server</short>
<descr>
<p>
<var>Disconnect</var> closes the communication channel with the server.
Any calls to <var>SendMessage</var> are invalid after <var>Disconnect</var>
was called.
</p>
<p>
<var>Disconnect</var> is called by the <link id="TSimpleIPCClient.Disconnect"/>
call or when the <link id="TSimpleIPC.Active">Active</link> property is set to
<var>False</var>.
</p>
<p>
Messages can no longer be sent after <var>Disconnect</var> was called.
</p>
</descr>
<errors>
If the connection shutdown fails, or the connection was already shut down,
then an exception may be raised.
</errors>
<seealso>
<link id="TSimpleIPCClient.Disconnect"/>
<link id="TSimpleIPC.Active">Active</link>
<link id="TIPCClientComm.Connect">Connect</link>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TIPCClientComm.ServerRunning">
<short>Check if the server is running.</short>
<descr>
<var>ServerRunning</var> returns <var>True</var> if the server endpoint for
the communication channel can be found, or <var>False</var> if not. The
server endpoint is obtained from the <var>ServerID</var> property in the owning
<link id="TSimpleIPCClient"/> component.
</descr>
<seealso>
<link id="TSimpleIPC.ServerID">ServerID</link>
<link id="TSimpleIPCServer.InstanceID">InstanceID</link>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="TIPCClientComm.ServerRunning.Result">
<short><var>True</var> if the server communication channel endpoint can be reached.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TIPCClientComm.SendMessage">
<short>Send a message</short>
<descr>
<var>SendMessage</var> should deliver the message with type
<var>MsgType</var> and data in <var>Stream</var> to the server.
It should not return until the message was delivered.
</descr>
<errors>
If the delivery of the message fails, an exception will be raised.
</errors>
</element>
<!-- argument Visibility: default -->
<element name="TIPCClientComm.SendMessage.MsgType">
<short>Type of message</short>
</element>
<!-- argument Visibility: default -->
<element name="TIPCClientComm.SendMessage.Stream">
<short>Message data</short>
</element>
<!-- "class of" type Visibility: default -->
<element name="TIPCClientCommClass">
<short>Class reference for <link
id="#fcl.simpleipc.TIPCClientComm">TIPCClientComm</link></short>
<descr>
<var>TIPCClientCommClass</var> is used by <link id="TSimpleIPCClient"/>
to decide which kind of communication channel to set up.
</descr>
<seealso>
<link id="TSimpleIPCClient"/>
<link id="TIPCClientComm"/>
</seealso>
</element>
<!--
********************************************************************
#fcl.simpleipc.TSimpleIPCClient
********************************************************************
-->
<!-- object Visibility: default -->
<element name="TSimpleIPCClient">
<short>Simple IPC client component</short>
<descr>
<p>
<var>TSimpleIPCClient</var> is the client side of the simple IPC
communication protocol. The client program should create a
<var>TSimpleIPCClient</var> instance, set its <var>ServerID</var>
property to the unique name for the server it wants to send
messages to, and then set the <var>Active</var> property to
<var>True</var>.
</p>
<p>
After the connection with the server was established, messages can be sent
to the server with the <link id="TSimpleIPCClient.SendMessage">SendMessage</link>
or <link id="TSimpleIPCClient.SendStringMessage">SendStringMessage</link>
calls.
</p>
</descr>
<seealso>
<link id="TSimpleIPCServer"/>
<link id="TSimpleIPC"/>
<link id="TIPCClientComm"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TSimpleIPCClient.Create">
<short>Create a new instance of <var>TSimpleIPCClient</var></short>
<descr>
<var>Create</var> instantiates a new instance of the
<var>TSimpleIPCClient</var> class. It initializes the data structures needed
to handle the client side of the communication.
</descr>
<seealso>
<link id="TSimpleIPCClient.Destroy">Destroy</link>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCClient.Create.AOwner">
<short>Owner of the instance</short>
</element>
<!-- destructor Visibility: public -->
<element name="TSimpleIPCClient.Destroy">
<short>Remove the <var>TSimpleIPCClient</var> instance from memory</short>
<descr>
<p>
<var>Destroy</var> disconnects the client from the server if need be, and
cleans up the internal data structures maintained by
<var>TSimpleIPCClient</var> and then calls the inherited <var>Destroy</var>,
which will remove the instance from memory.
</p>
<p>
Never call <var>Destroy</var> directly, use the <var>Free</var> method
instead or the <var>FreeAndNil</var> procedure in <file>SysUtils</file>.
</p>
</descr>
<seealso>
<link id="TSimpleIPCClient.Create">Create</link>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TSimpleIPCClient.Connect">
<short>Connect to the server</short>
<descr>
<p>
<var>Connect</var> connects to the server indicated in the <link
id="TSimpleIPC.ServerID">ServerID</link> and <link
id="TSimpleIPCServer.InstanceID">InstanceID</link> properties. <var>Connect</var> is called
automatically if the <link id="TSimpleIPC.Active">Active</link> property is
set to <var>True</var>.
</p>
<p>
After a successful call to <var>Connect</var>, messages can be sent to
the server using <link id="TSimpleIPCClient.SendMessage">SendMessage</link>
or <link id="TSimpleIPCClient.SendStringMessage">SendStringMessage</link>.
</p>
<p>
Calling <var>Connect</var> if the connection is already open has no effect.
</p>
</descr>
<errors>
If creating the connection fails, an <link id="EIPCError"/> exception may be
raised.
</errors>
<seealso>
<link id="TSimpleIPC.ServerID">ServerID</link>
<link id="TSimpleIPCClient.InstanceID">InstanceID</link>
<link id="TSimpleIPC.Active">Active</link>
<link id="TSimpleIPCClient.SendMessage">SendMessage</link>
<link id="TSimpleIPCClient.SendStringMessage">SendStringMessage</link>
<link id="TSimpleIPCClient.Disconnect">Disconnect</link>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TSimpleIPCClient.Disconnect">
<short>Disconnect from the server</short>
<descr>
<p>
<var>Disconnect</var> shuts down the connection with the server as
previously set up with <link id="TSimpleIPCClient.Connect">Connect</link>.
<var>Disconnect</var> is called automatically if the <link id="TSimpleIPC.Active">Active</link> property is
set to <var>False</var>.
</p>
<p>
After a successful call to <var>Disconnect</var>, messages can no longer
be sent to the server. Attempting to do so will result in an exception.
</p>
<p>
Calling <var>Disconnect</var> if there is no connection has no effect.
</p>
</descr>
<errors>
If creating the connection fails, an <link id="EIPCError"/> exception may be
raised.
</errors>
<seealso>
<link id="TSimpleIPC.Active">Active</link>
<link id="TSimpleIPCClient.Connect">Connect</link>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TSimpleIPCClient.ServerRunning">
<short>Check if the server is running.</short>
<descr>
<var>ServerRunning</var> verifies if the server indicated in the <link
id="TSimpleIPC.ServerID">ServerID</link> and <link
id="TSimpleIPCServer.InstanceID">InstanceID</link> properties is running.
It returns <var>True</var> if the server communication endpoint can be
reached, <var>False</var> otherwise. This function can be called before
a connection is made.
</descr>
<seealso>
<link id="TSimpleIPCClient.Connect">Connect</link>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="TSimpleIPCClient.ServerRunning.Result">
<short><var>True</var> if the server can be reached</short>
</element>
<!-- procedure Visibility: public -->
<element name="TSimpleIPCClient.SendMessage">
<short>Send a message to the server</short>
<descr>
<var>SendMessage</var> sends a message of type <var>MsgType</var> and data
from <var>stream</var> to the server. The client must be connected for this
call to work.
</descr>
<errors>
In case an error occurs, or there is no connection to the server,
an <link id="EIPCError"/> exception is raised.
</errors>
<seealso>
<link id="TSimpleIPCClient.Connect">Connect</link>
<link id="TSimpleIPCClient.SendStringMessage">SendStringMessage</link>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCClient.SendMessage.MsgType">
<short>Message type</short>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCClient.SendMessage.Stream">
<short>Message data.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TSimpleIPCClient.SendStringMessage">
<short>Send a string message to the server</short>
<descr>
<var>SendStringMessage</var> sends a string message with type
<var>MsgTyp</var> and data <var>Msg</var> to the server. This is a
convenience function: a small wrapper around the
<link id="TSimpleIPCClient.SendMessage">SendMessage</link> method
</descr>
<errors>
Same as for <var>SendMessage</var>.
</errors>
<seealso>
<link id="TSimpleIPCClient.SendMessage">SendMessage</link>
<link id="TSimpleIPCClient.Connect">Connect</link>
<link id="TSimpleIPCClient.SendStringMessageFmt">SendStringMessageFmt</link>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCClient.SendStringMessage.Msg">
<short>String message</short>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCClient.SendStringMessage.MsgType">
<short>Message type</short>
</element>
<!-- procedure Visibility: public -->
<element name="TSimpleIPCClient.SendStringMessageFmt">
<short>Send a formatted string message</short>
<descr>
<var>SendStringMessageFmt</var> sends a string message with type
<var>MsgTyp</var> and message formatted from <var>Msg</var> and
<var>Args</var> to the server. This is a convenience function:
a small wrapper around the <link
id="TSimpleIPCClient.SendStringMessage">SendStringMessage</link> method
</descr>
<errors>
Same as for <var>SendMessage</var>.
</errors>
<seealso>
<link id="TSimpleIPCClient.SendMessage">SendMessage</link>
<link id="TSimpleIPCClient.Connect">Connect</link>
<link id="TSimpleIPCClient.SendStringMessage">SendStringMessage</link>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCClient.SendStringMessageFmt.Msg">
<short>Format string for message</short>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCClient.SendStringMessageFmt.Args">
<short>Arguments to format string with</short>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCClient.SendStringMessageFmt.MsgType">
<short>Message type.</short>
</element>
<!-- property Visibility: public -->
<element name="TSimpleIPCClient.ServerInstance">
<short>Server instance identification</short>
<descr>
<var>ServerInstance</var> should be used in case a particular instance of
the server identified with <var>ServerID</var> should be contacted. This
must be used if the server has its <link
id="TSimpleIPCServer.Global">GLobal</link> property set to <var>False</var>,
and should match the server's <link id="TSimpleIPCServer.InstanceID">InstanceID</link> property.
</descr>
<seealso>
<link id="TSimpleIPC.ServerID">ServerID</link>
<link id="TSimpleIPCServer.Global">GLobal</link>
<link id="TSimpleIPCServer.InstanceID">InstanceID</link>
</seealso>
</element>
<!--
********************************************************************
#fcl.simpleipc.EIPCError
********************************************************************
-->
<!-- object Visibility: default -->
<element name="EIPCError">
<short>Error reporting exception</short>
<descr>
<var>EIPCError</var> is the exception used by the various classes in the
<file>SimpleIPC</file> unit to report errors.
</descr>
</element>
<!-- variable Visibility: default -->
<element name="DefaultIPCServerClass">
<short>Default server communication class</short>
<descr>
<var>DefaultIPCServerClass</var> is filled with a class pointer indicating
which kind of communication protocol class should be instantiated by the <link
id="TSimpleIPCServer"/> class. It is set to a default value by the default
implementation in the <file>SimpleIPC</file> unit, but can be set to another
class if another method of transport is desired.
</descr>
<seealso>
<link id="TSimpleIPCServer"/>
<link id="TIPCServerComm"/>
</seealso>
</element>
<!-- variable Visibility: default -->
<element name="DefaultIPCClientClass">
<short>Default client communication class</short>
<descr>
<var>DefaultIPCClientClass</var> is filled with a class pointer indicating
which kind of communication protocol class should be instantiated by the
<link id="TSimpleIPCClient"/> class. It is set to a default value by the default
implementation in the <file>SimpleIPC</file> unit, but can be set to another
class if another method of transport is desired. (it should match the
communication protocol used by the server, obviously).
</descr>
<seealso>
<link id="TSimpleIPCClient"/>
<link id="TIPCClientComm"/>
</seealso>
</element>
<!-- resource string Visibility: default -->
<element name="SErrServerNotActive">
<short>Error message if server is not active</short>
</element>
<!-- resource string Visibility: default -->
<element name="SErrActive">
<short>Error message if client/server is active.</short>
</element>
<!-- resource string Visibility: default -->
<element name="SErrInActive">
<short>Error message if client/server is not active.</short>
</element>
<!-- constant Visibility: default -->
<element name="DefaultThreadTimeOut">
<short>Default timeout (in milliseconds) for thread-based waiting for a message</short>
<descr>
</descr>
<seealso>
</seealso>
</element>
<!-- enumeration type Visibility: default -->
<element name="TIPCMessageOverflowAction">
<short>Action to take when the message queue is going to overflow</short>
<descr>
<p>
<var>TIPCMessageOverflowAction</var> describes what will happen if the message queue hits the size limit for the queue.
</p>
<dl>
<dt></dt><dd><printshort id="TIPCMessageOverflowAction.ipcmoaNone"/></dd>
<dt></dt><dd><printshort id="TIPCMessageOverflowAction.ipcmoaDiscardOld"/></dd>
<dt></dt><dd><printshort id="TIPCMessageOverflowAction.ipcmoaDiscardNew"/></dd>
</dl>
</descr>
<seealso>
<link id="DefaultIPCMessageOverflowAction"/>
<link id="TIPCServerMsgQueue.MaxAction"/>
<link id="TIPCServerMsgQueue.MaxCount"/>
</seealso>
</element>
<!-- enumeration value Visibility: default -->
<element name="TIPCMessageOverflowAction.ipcmoaNone">
<short>Do nothing, just add the message</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TIPCMessageOverflowAction.ipcmoaDiscardOld">
<short>Discard the oldest message</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TIPCMessageOverflowAction.ipcmoaDiscardNew">
<short>Discard the new message</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TIPCMessageOverflowAction.ipcmoaError">
<short>Raise an error</short>
</element>
<!-- variable Visibility: default -->
<element name="DefaultIPCMessageOverflowAction">
<short>Default action to take take when the message queue is going to overflow</short>
<descr>
<var>DefaultIPCMessageOverflowAction</var> is the default for the message queue overflow action
when a new queue is made.
</descr>
<seealso>
<link id="TIPCServerMsgQueue.MaxAction"/>
<link id="TIPCServerMsgQueue.MaxCount"/>
<link id="TIPCMessageOverflowAction"/>
<link id="DefaultIPCMessageQueueLimit"/>
</seealso>
</element>
<!-- variable Visibility: default -->
<element name="DefaultIPCMessageQueueLimit">
<short>Default maximum queue message size</short>
<descr>
<var>DefaultIPCMessageOverflowAction</var> is the default for the maximum message
queue size when a new queue is made. A zero size means no limit.
</descr>
<seealso>
<link id="TIPCServerMsgQueue.MaxCount"/>
</seealso>
</element>
<!--
********************************************************************
#fcl.simpleipc.TIPCServerMsg
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TIPCServerMsg">
<short>Server message queue class</short>
<descr>
<var>TIPCServerMsg</var> is an auxiliary class used in the IPC server class <link
id="TSimpleIPCServer"/>. It keeps the data for 1 message. The set of
messages is managed in <link id="TIPCServerMsgQueue"/>. There should
normally be no need to use this class directly.
</descr>
<seealso>
<link id="TIPCServerMsgQueue"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TIPCServerMsg.Create">
<short>Create a new instance of a server message</short>
<descr>
<var>Create</var> initializes the stream used to hold the message data.
</descr>
<seealso>
<link id="TIPCServerMsg.Destroy"/>
</seealso>
</element>
<!-- destructor Visibility: public -->
<element name="TIPCServerMsg.Destroy">
<short>Destroy an instance of a server message</short>
<descr>
<var>Destroy</var> frees the stream used to hold the message data.
</descr>
<seealso>
<link id="TIPCServerMsg.Create"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TIPCServerMsg.Stream">
<short>Stream to store message data</short>
<descr>
<var>Stream</var> contains the message data as binary data.
</descr>
<seealso>
<link id="TIPCServerMsg.MsgType"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TIPCServerMsg.MsgType">
<short>Message type</short>
<descr>
<var>MsgType</var> simply contains the message type. The possible message types are application defined.
</descr>
<seealso>
<link id="TIPCServerMsg.Stream"/>
</seealso>
</element>
<!--
********************************************************************
#fcl.simpleipc.TIPCServerMsgQueue
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TIPCServerMsgQueue">
<short>A simple message queue, with FIFO characteristics and overflow
management</short>
<descr>
<var>TIPCServerMsgQueue</var> implements a message queue with FIFO characteristics.
It has support for a maximum queue length (<link id="TIPCServerMsgQueue.MaxCount"/>)
and various ways of dealing with overflowing queue (<link id="TIPCServerMsgQueue.MaxAction"/>)
</descr>
<seealso>
<link id="TIPCServerMsgQueue.MaxCount"/>
<link id="TIPCServerMsgQueue.MaxAction"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TIPCServerMsgQueue.Create">
<short>Create a new message queue instance</short>
<descr>
<p>
<var>Create</var> creates a list to contain the messages, and initializes
<link id="TIPCServerMsgQueue.MaxCount"/> and <link id="TIPCServerMsgQueue.MaxAction"/> with their default values
(<link id="DefaultIPCMessageQueueLimit"/> and <link id="DefaultIPCMessageOverflowAction"/>, respectively)
</p>
<p>
Note that the messages are owned by the queue till they are popped of the queue.
</p>
</descr>
<seealso>
<link id="TIPCServerMsgQueue.MaxCount"/>
<link id="TIPCServerMsgQueue.MaxAction"/>
<link id="DefaultIPCMessageQueueLimit"/>
<link id="DefaultIPCMessageOverflowAction"/>
</seealso>
</element>
<!-- destructor Visibility: public -->
<element name="TIPCServerMsgQueue.Destroy">
<short>Destroy server message queue instance</short>
<descr>
<var>Destroy</var> discards the remaining messages in the list and removes the message queue from memory.
</descr>
<seealso>
<link id="TIPCServerMsgQueue.Create"/>
<link id="TIPCServerMsgQueue.Clear"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TIPCServerMsgQueue.Clear">
<short>Clear the message queue</short>
<descr>
<var>Clear</var> discards the remaining messages in the list.
</descr>
</element>
<!-- procedure Visibility: public -->
<element name="TIPCServerMsgQueue.Push">
<short>Add a new message to the queue</short>
<descr>
<p>
<var>Push</var> verifies if the message can be added to the queue
(discarding old messages depending on the setting of <link
id="TIPCServerMsgQueue.MaxAction"/>) and adds the message <var>AItem</var> to the
queue.
</p>
<p>
The message <var>AItem</var> is owned by the queue until it is popped off the queue.
</p>
</descr>
<errors>
If the maximum queue length is reached, and the <link
id="TIPCServerMsgQueue.MaxAction">MaxAction</link> is set to
<var>ipcmoaError</var>, an exception will be raised.
</errors>
<seealso>
<link id="TIPCServerMsgQueue.MaxCount"/>
<link id="TIPCServerMsgQueue.MaxAction"/>
<link id="TIPCServerMsgQueue.Pop"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TIPCServerMsgQueue.Push.AItem">
<short>New message to add to the queue</short>
</element>
<!-- function Visibility: public -->
<element name="TIPCServerMsgQueue.Pop">
<short>Remove the oldest message from the queue </short>
<descr>
<var>Pop</var> removes the oldest message from the queue if there is one, and returns it.
If none exists, <var>Nil</var> is returned. The caller is responsible for
freeing the message instance.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TIPCServerMsgQueue.Push"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TIPCServerMsgQueue.Pop.Result">
<short>Oldest message in the queue, or <var>Nil</var></short>
</element>
<!-- property Visibility: public -->
<element name="TIPCServerMsgQueue.Count">
<short>Number of messages in the queue</short>
<descr>
<var>Count</var> is the current number of messages in the queue.
</descr>
<seealso>
<link id="TIPCServerMsgQueue.MaxCount">MaxCount</link>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TIPCServerMsgQueue.MaxCount">
<short>Maximum number of messages in the queue, 0 for unlimited</short>
<descr>
<p>
<var>MaxCount</var> is the maximum number of messages in the queue.
When this amount is zero, the amount of messages is unlimited.
</p>
<p>
When a new message is pushed, and the <link
id="TIPCServerMsgQueue.Count">Count</link> is equal to <var>MaxCount</var>,
the <link id="TIPCServerMsgQueue.MaxAction">MaxAction</link> property is
examined to know what to do.
</p>
</descr>
<seealso>
<link id="TIPCServerMsgQueue.Count">Count</link>
<link id="TIPCServerMsgQueue.MaxAction">MaxAction</link>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TIPCServerMsgQueue.MaxAction">
<short>Action to take when the number of messages will exceed <var>MaxCount</var>.</short>
<descr>
<p>
<var>MaxAction</var> determines what will happen if the current <link
id="TIPCServerMsgQueue.Count">Count</link> equals <link
id="TIPCServerMsgQueue.MaxCount">MaxCount</link> and a new message is put in
the queue using <link id="TIPCServerMsgQueue.Push">Push</link>:
</p>
<dl>
<dt></dt><dd><printshort id="TIPCMessageOverflowAction.ipcmoaNone"/></dd>
<dt></dt><dd><printshort
id="TIPCMessageOverflowAction.ipcmoaDiscardOld"/></dd>
<dt></dt><dd><printshort
id="TIPCMessageOverflowAction.ipcmoaDiscardNew"/></dd>
</dl>
</descr>
<seealso>
<link id="TIPCServerMsgQueue.Count"/>
<link id="TIPCServerMsgQueue.MaxCount"/>
<link id="TIPCServerMsgQueue.Push"/>
<link id="TIPCMessageOverflowAction"/>
</seealso>
</element>
<!-- procedure type Visibility: default -->
<element name="TMessageQueueEvent">
<short>Event handler, executed when a message is detected on the queue.</short>
<descr>
<var>TMessageQueueEvent</var> is the signature of the event handler that is
executed when a new message arrives on the server and the queue is full, and
maxaction is <var>ipcmoaError</var>.
</descr>
<seealso>
<link id="TSimpleIPCServer.OnMessageError"/>
<link id="TSimpleIPCServer"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TMessageQueueEvent.Sender">
<short><var>TSimpleIPCServer</var> instance on which the message arrives.</short>
</element>
<!-- argument Visibility: default -->
<element name="TMessageQueueEvent.Msg">
<short>Message that arrived on the queue</short>
</element>
<!-- argument Visibility: public -->
<element name="TSimpleIPCServer.StartServer.Threaded">
<short>Start the server in threaded mode.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TSimpleIPCServer.ReadMessage">
<short>Read message from the queue</short>
<descr>
<p>
<var>ReadMessage</var> will read the oldest message from the queue, and make
it available in <link id="TSimpleIPCServer.MsgType"/> and <link id="TSimpleIPCServer.MsgData"/>
</p>
<p>
It is safe to call this even if a watch thread is started.
</p>
</descr>
<seealso>
<link id="TSimpleIPCServer.MsgType"/>
<link id="TSimpleIPCServer.MsgData"/>
</seealso>
</element>
<!-- property Visibility: published -->
<element name="TSimpleIPCServer.ThreadTimeOut">
<short>Timeout waiting for message</short>
<descr>
<p>
<var>ThreadTimeOut</var> is the time the thread will wait for messages
between loop iterations, if the server is started with threading enabled.
</p>
<p>
When stopping the server, this is also the maximum time the server will be
blocked when stopping, because it needs to wait for the thread to stop.
</p>
</descr>
<seealso>
<link id="TSimpleIPCServer.StartServer"/>
<link id="TSimpleIPCServer.StopServer"/>
</seealso>
</element>
<!-- property Visibility: published -->
<element name="TSimpleIPCServer.OnMessageQueued">
<short>Event called when a new message has arrived</short>
<descr>
<var>OnMessageQueued</var> is an event handler that is called whenever a new message is pushed on the queue.
</descr>
<seealso>
<link id="TSimpleIPCServer.PeekMessage"/>
<link id="TSimpleIPCServer.OnMessageError"/>
</seealso>
</element>
<!-- property Visibility: published -->
<element name="TSimpleIPCServer.OnMessageError">
<short>Event called when a new message has arrived, and the queue is full</short>
<descr>
<var>OnMessageError</var> is called whenever the message queue is full and a
new message arrives on the server, and<link id="TIPCServerMsgQueue.MaxAction">MaxAction</link>
is<var>ipcmoaError</var>.
</descr>
<seealso>
</seealso>
</element>
<!-- property Visibility: published -->
<element name="TSimpleIPCServer.MaxQueue">
<short>Maximum number of messages in the queue, 0 for unlimited</short>
<descr>
<p>
<var>MaxQueue</var> is the maximum number of messages in the queue.
When this amount is zero, the amount of messages is unlimited.
</p>
<p>
When a new message is pushed, and the <link id="TIPCServerMsgQueue.Count">Count</link>
is equal to <var>MaxQueue</var>, the <link id="TSimpleIPCServer.MaxAction">MaxAction</link> property is
examined to know what to do.
</p>
</descr>
<seealso>
<link id="TSimpleIPCServer.MaxAction">MaxAction</link>
</seealso>
</element>
<!-- property Visibility: published -->
<element name="TSimpleIPCServer.MaxAction">
<short>Action to take when the number of messages will exceed <var>MaxQueue</var>.</short>
<descr>
<p>
<var>MaxAction</var> determines what will happen if the number of messages
on the queue equals <link id="TSimpleIPCServer.MaxQueue">MaxQueue</link>
and a new message is put in the queue during <link id="TSimpleIPCServer.PeekMessage">PeekMessage</link>:
</p>
<dl>
<dt></dt><dd><printshort id="TIPCMessageOverflowAction.ipcmoaNone"/></dd>
<dt></dt><dd><printshort
id="TIPCMessageOverflowAction.ipcmoaDiscardOld"/></dd>
<dt></dt><dd><printshort
id="TIPCMessageOverflowAction.ipcmoaDiscardNew"/></dd>
</dl>
</descr>
<seealso>
<link id="TSimpleIPCServer.MaxQueue"/>
<link id="TSimpleIPCServer.PeekMessage"/>
<link id="TIPCMessageOverflowAction"/>
</seealso>
</element>
<!-- uses unit Visibility: default -->
<element name="Contnrs">
<short>Hash/object list</short>
</element>
<!-- uses unit Visibility: default -->
<element name="SyncObjs">
<short>Critical sections</short>
</element>
<!-- argument Visibility: default -->
<element name="TIPCServerMsg.Create.AStream">
<short>Stream containing message data</short>
</element>
<!-- argument Visibility: default -->
<element name="TIPCServerMsg.Create.AOwnsStream">
<short>Does the messag own the stream</short>
</element>
<!-- property Visibility: public -->
<element name="TIPCServerMsg.OwnsStream">
<short>Does the message own the stream</short>
<descr>
<var>OwnsStream</var> can be set to true to signal that the message should release the stream when the message is destroyed.
The initial value can be specified in the constructor.
</descr>
<seealso>
<link id="TIPCServerMsg.Create"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TIPCServerMsg.StringMessage">
<short>String message sent by client</short>
<descr>
<var>StringMessage</var> is the message sent by the client as a string.
</descr>
</element>
<!-- argument Visibility: default -->
<element name="TSimpleIPCServer.StartServer.AThreaded">
<short>Should the server run threaded ?</short>
</element>
<!-- function result Visibility: default -->
<element name="TSimpleIPCServer.ReadMessage.Result">
<short>True if a message was read by the server and pushed to the queue</short>
</element>
<!-- property Visibility: public -->
<element name="TSimpleIPCServer.Message">
<short>Last read message</short>
<descr>
<var>Message</var> is the last read message (using <link id="TSimpleIPCServer.ReadMessage"/>) from the message queue.
</descr>
<seealso>
<link id="TSimpleIPCServer.ReadMessage"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TSimpleIPCServer.ThreadExecuting">
<short>Is the message thread currently executing ?</short>
<descr>
<var>ThreadExecuting</var> is true if the server is currently running a message loop in a thread and the thread is in an executing state.
</descr>
<seealso>
<link id="TSimpleIPCServer.ThreadError"/>
<link id="TSimpleIPCServer.StartServer"/>
<link id="TSimpleIPCServer.OnThreadError"/>
<link id="TSimpleIPCServer.Threaded"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TSimpleIPCServer.ThreadError">
<short>Last thread error</short>
<descr>
<var>ThreadError</var> is the last error reported by the thread (or none if no error was caught).
</descr>
<seealso>
<link id="TSimpleIPCServer.ThreadExecuting"/>
<link id="TSimpleIPCServer.StartServer"/>
<link id="TSimpleIPCServer.OnThreadError"/>
<link id="TSimpleIPCServer.Threaded"/>
</seealso>
</element>
<!-- property Visibility: published -->
<element name="TSimpleIPCServer.OnThreadError">
<short>Triggered when a thread reports an error</short>
<descr>
<var>OnThreadError</var> is triggered when the server thread reports an error.
The actual error message can be examined in <link id="TSimpleIPCServer.ThreadError"/>
</descr>
<seealso>
<link id="TSimpleIPCServer.ThreadExecuting"/>
<link id="TSimpleIPCServer.StartServer"/>
<link id="TSimpleIPCServer.OnThreadError"/>
<link id="TSimpleIPCServer.ThreadError"/>
<link id="TSimpleIPCServer.Threaded"/>
</seealso>
</element>
<!-- property Visibility: published -->
<element name="TSimpleIPCServer.Threaded">
<short>Is the server running threaded or not ?</short>
<descr>
<var>Threaded</var> indicates whether the server was started in threaded mode or not.
It can be set before calling <link id="TSimpleIPCServer.StartServer">StartServer</link>.
Trying to set it when the server is started will result in an error.
</descr>
<seealso>
<link id="TSimpleIPCServer.StartServer">StartServer</link>
</seealso>
</element>
<!-- property Visibility: published -->
<element name="TSimpleIPCServer.SynchronizeEvents">
<short>Should events be run in the main thread ?</short>
<descr>
<var>SynchronizeEvents</var> can be set to <var>True</var> to force execution of events in the main thread, when the server is running in threaded mode.
If set to <var>False</var>, the events will be triggered in the thread responsible for checking messages.
It is ignored when the server is not running threaded. It cannot be set when the server is already started.
</descr>
<seealso>
<link id="TSimpleIPCServer.Threaded"/>
<link id="TSimpleIPCServer.StartServer">StartServer</link>
</seealso>
</element>
<!-- resource string Visibility: default -->
<element name="SErrThreadContext">
<short>Thread context error message.</short>
</element>
<!-- resource string Visibility: default -->
<element name="SErrThreadFailure">
<short>Thread failure message</short>
</element>
<!-- resource string Visibility: default -->
<element name="SErrMessageQueueOverflow">
<short>Too many messages in the message queue</short>
</element>
</module> <!-- simpleipc -->
</package>
</fpdoc-descriptions>
|