/usr/share/gtk-doc/html/loudmouth/loudmouth-lm-connection.html is in libloudmouth1-dev 1.4.3-10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>LmConnection</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Loudmouth Reference Manual">
<link rel="up" href="ch01.html" title="Loudmouth">
<link rel="prev" href="ch01.html" title="Loudmouth">
<link rel="next" href="loudmouth-lm-error.html" title="LmError">
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Loudmouth Reference Manual</th>
<td><a accesskey="n" href="loudmouth-lm-error.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#loudmouth-lm-connection.synopsis" class="shortcut">Top</a>
|
<a href="#loudmouth-lm-connection.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="loudmouth-lm-connection"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="loudmouth-lm-connection.top_of_page"></a>LmConnection</span></h2>
<p>LmConnection — A client connection to the server</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="loudmouth-lm-connection.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">#define <a class="link" href="loudmouth-lm-connection.html#LM-CONNECTION:CAPS" title="LM_CONNECTION()">LM_CONNECTION</a> (o)
#define <a class="link" href="loudmouth-lm-connection.html#LM-CONNECTION-DEFAULT-PORT:CAPS" title="LM_CONNECTION_DEFAULT_PORT">LM_CONNECTION_DEFAULT_PORT</a>
#define <a class="link" href="loudmouth-lm-connection.html#LM-CONNECTION-DEFAULT-PORT-SSL:CAPS" title="LM_CONNECTION_DEFAULT_PORT_SSL">LM_CONNECTION_DEFAULT_PORT_SSL</a>
<a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection">LmConnection</a>;
enum <a class="link" href="loudmouth-lm-connection.html#LmHandlerResult" title="enum LmHandlerResult">LmHandlerResult</a>;
enum <a class="link" href="loudmouth-lm-connection.html#LmHandlerPriority" title="enum LmHandlerPriority">LmHandlerPriority</a>;
enum <a class="link" href="loudmouth-lm-connection.html#LmDisconnectReason" title="enum LmDisconnectReason">LmDisconnectReason</a>;
enum <a class="link" href="loudmouth-lm-connection.html#LmConnectionState" title="enum LmConnectionState">LmConnectionState</a>;
<span class="returnvalue">void</span> (<a class="link" href="loudmouth-lm-connection.html#LmResultFunction" title="LmResultFunction ()">*LmResultFunction</a>) (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> success</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);
<span class="returnvalue">void</span> (<a class="link" href="loudmouth-lm-connection.html#LmDisconnectFunction" title="LmDisconnectFunction ()">*LmDisconnectFunction</a>) (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmDisconnectReason" title="enum LmDisconnectReason"><span class="type">LmDisconnectReason</span></a> reason</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);
<a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="returnvalue">LmConnection</span></a> * <a class="link" href="loudmouth-lm-connection.html#lm-connection-new" title="lm_connection_new ()">lm_connection_new</a> (<em class="parameter"><code>const <span class="type">gchar</span> *server</code></em>);
<a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="returnvalue">LmConnection</span></a> * <a class="link" href="loudmouth-lm-connection.html#lm-connection-new-with-context" title="lm_connection_new_with_context ()">lm_connection_new_with_context</a> (<em class="parameter"><code>const <span class="type">gchar</span> *server</code></em>,
<em class="parameter"><code><span class="type">GMainContext</span> *context</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-open" title="lm_connection_open ()">lm_connection_open</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmResultFunction" title="LmResultFunction ()"><span class="type">LmResultFunction</span></a> function</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> notify</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-open-and-block" title="lm_connection_open_and_block ()">lm_connection_open_and_block</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-close" title="lm_connection_close ()">lm_connection_close</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-authenticate" title="lm_connection_authenticate ()">lm_connection_authenticate</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *username</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *password</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *resource</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmResultFunction" title="LmResultFunction ()"><span class="type">LmResultFunction</span></a> function</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> notify</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-authenticate-and-block" title="lm_connection_authenticate_and_block ()">lm_connection_authenticate_and_block</a>
(<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *username</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *password</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *resource</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);
<span class="returnvalue">guint</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-get-keep-alive-rate" title="lm_connection_get_keep_alive_rate ()">lm_connection_get_keep_alive_rate</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);
<span class="returnvalue">void</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-set-keep-alive-rate" title="lm_connection_set_keep_alive_rate ()">lm_connection_set_keep_alive_rate</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">guint</span> rate</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-is-open" title="lm_connection_is_open ()">lm_connection_is_open</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-is-authenticated" title="lm_connection_is_authenticated ()">lm_connection_is_authenticated</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);
const <span class="returnvalue">gchar</span> * <a class="link" href="loudmouth-lm-connection.html#lm-connection-get-server" title="lm_connection_get_server ()">lm_connection_get_server</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);
<span class="returnvalue">void</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-set-server" title="lm_connection_set_server ()">lm_connection_set_server</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *server</code></em>);
const <span class="returnvalue">gchar</span> * <a class="link" href="loudmouth-lm-connection.html#lm-connection-get-jid" title="lm_connection_get_jid ()">lm_connection_get_jid</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);
<span class="returnvalue">void</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-set-jid" title="lm_connection_set_jid ()">lm_connection_set_jid</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *jid</code></em>);
<span class="returnvalue">guint</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-get-port" title="lm_connection_get_port ()">lm_connection_get_port</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);
<span class="returnvalue">void</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-set-port" title="lm_connection_set_port ()">lm_connection_set_port</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">guint</span> port</code></em>);
<a class="link" href="loudmouth-lm-ssl.html#LmSSL" title="LmSSL"><span class="returnvalue">LmSSL</span></a> * <a class="link" href="loudmouth-lm-connection.html#lm-connection-get-ssl" title="lm_connection_get_ssl ()">lm_connection_get_ssl</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);
<span class="returnvalue">void</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-set-ssl" title="lm_connection_set_ssl ()">lm_connection_set_ssl</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-ssl.html#LmSSL" title="LmSSL"><span class="type">LmSSL</span></a> *ssl</code></em>);
<a class="link" href="loudmouth-lm-proxy.html#LmProxy" title="LmProxy"><span class="returnvalue">LmProxy</span></a> * <a class="link" href="loudmouth-lm-connection.html#lm-connection-get-proxy" title="lm_connection_get_proxy ()">lm_connection_get_proxy</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);
<span class="returnvalue">void</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-set-proxy" title="lm_connection_set_proxy ()">lm_connection_set_proxy</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-proxy.html#LmProxy" title="LmProxy"><span class="type">LmProxy</span></a> *proxy</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-send" title="lm_connection_send ()">lm_connection_send</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-message.html#LmMessage" title="LmMessage"><span class="type">LmMessage</span></a> *message</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-send-with-reply" title="lm_connection_send_with_reply ()">lm_connection_send_with_reply</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-message.html#LmMessage" title="LmMessage"><span class="type">LmMessage</span></a> *message</code></em>,
<em class="parameter"><code><span class="type">LmMessageHandler</span> *handler</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);
<a class="link" href="loudmouth-lm-message.html#LmMessage" title="LmMessage"><span class="returnvalue">LmMessage</span></a> * <a class="link" href="loudmouth-lm-connection.html#lm-connection-send-with-reply-and-block" title="lm_connection_send_with_reply_and_block ()">lm_connection_send_with_reply_and_block</a>
(<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-message.html#LmMessage" title="LmMessage"><span class="type">LmMessage</span></a> *message</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);
<span class="returnvalue">void</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-register-message-handler" title="lm_connection_register_message_handler ()">lm_connection_register_message_handler</a>
(<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">LmMessageHandler</span> *handler</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-message.html#LmMessageType" title="enum LmMessageType"><span class="type">LmMessageType</span></a> type</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmHandlerPriority" title="enum LmHandlerPriority"><span class="type">LmHandlerPriority</span></a> priority</code></em>);
<span class="returnvalue">void</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-unregister-message-handler" title="lm_connection_unregister_message_handler ()">lm_connection_unregister_message_handler</a>
(<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">LmMessageHandler</span> *handler</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-message.html#LmMessageType" title="enum LmMessageType"><span class="type">LmMessageType</span></a> type</code></em>);
<span class="returnvalue">void</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-set-disconnect-function" title="lm_connection_set_disconnect_function ()">lm_connection_set_disconnect_function</a>
(<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmDisconnectFunction" title="LmDisconnectFunction ()"><span class="type">LmDisconnectFunction</span></a> function</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> notify</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-send-raw" title="lm_connection_send_raw ()">lm_connection_send_raw</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *str</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);
<a class="link" href="loudmouth-lm-connection.html#LmConnectionState" title="enum LmConnectionState"><span class="returnvalue">LmConnectionState</span></a> <a class="link" href="loudmouth-lm-connection.html#lm-connection-get-state" title="lm_connection_get_state ()">lm_connection_get_state</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);
<a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="returnvalue">LmConnection</span></a> * <a class="link" href="loudmouth-lm-connection.html#lm-connection-ref" title="lm_connection_ref ()">lm_connection_ref</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);
<span class="returnvalue">void</span> <a class="link" href="loudmouth-lm-connection.html#lm-connection-unref" title="lm_connection_unref ()">lm_connection_unref</a> (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="loudmouth-lm-connection.description"></a><h2>Description</h2>
<p>
An example of how to use Loudmouth with the synchronous API.
</p>
<div class="informalexample"><pre class="programlisting">
int
main (int argc, char **argv)
{
LmConnection *connection;
GError *error = NULL;
gint i;
LmMessage *m;
connection = lm_connection_new ("myserver");
if (!lm_connection_open_and_block (connection, &error)) {
g_error ("Failed to open: %s\n", error->message);
}
if (!lm_connection_authenticate_and_block (connection,
"username", "password",
"resource",
&error)) {
g_error ("Failed to authenticate: %s\n", error->message);
}
m = lm_message_new ("recipient", LM_MESSAGE_TYPE_MESSAGE);
lm_message_node_add_child (m->node, "body", "message");
if (!lm_connection_send (connection, m, &error)) {
g_error ("Send failed: %s\n", error->message);
}
lm_message_unref (m);
lm_connection_close (connection, NULL);
lm_connection_unref (connection);
return 0;
}
</pre></div>
<p>
</p>
</div>
<div class="refsect1">
<a name="loudmouth-lm-connection.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="LM-CONNECTION:CAPS"></a><h3>LM_CONNECTION()</h3>
<pre class="programlisting">#define LM_CONNECTION(o) (LmConnection *) o;
</pre>
<p>
Convenience macro used to cast a pointer to a <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>o</code></em> :</span></p></td>
<td>pointer to cast</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="LM-CONNECTION-DEFAULT-PORT:CAPS"></a><h3>LM_CONNECTION_DEFAULT_PORT</h3>
<pre class="programlisting">#define LM_CONNECTION_DEFAULT_PORT 5222
</pre>
<p>
Default jabber client port.
</p>
</div>
<hr>
<div class="refsect2">
<a name="LM-CONNECTION-DEFAULT-PORT-SSL:CAPS"></a><h3>LM_CONNECTION_DEFAULT_PORT_SSL</h3>
<pre class="programlisting">#define LM_CONNECTION_DEFAULT_PORT_SSL 5223
</pre>
<p>
Default jabber client port when using SSL encryption.
</p>
</div>
<hr>
<div class="refsect2">
<a name="LmConnection"></a><h3>LmConnection</h3>
<pre class="programlisting">typedef struct _LmConnection LmConnection;</pre>
<p>
This should not be accessed directly. Use the accessor functions as described below.
</p>
</div>
<hr>
<div class="refsect2">
<a name="LmHandlerResult"></a><h3>enum LmHandlerResult</h3>
<pre class="programlisting">typedef enum {
LM_HANDLER_RESULT_REMOVE_MESSAGE,
LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS
} LmHandlerResult;
</pre>
<p>
The return type of an LmMessageHandler. This determines whether more message handlers should be called.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><a name="LM-HANDLER-RESULT-REMOVE-MESSAGE:CAPS"></a><span class="term"><code class="literal">LM_HANDLER_RESULT_REMOVE_MESSAGE</code></span></p></td>
<td>Stop calling message handlers. The message handler returning this declares the message has been handled and should be removed.
</td>
</tr>
<tr>
<td><p><a name="LM-HANDLER-RESULT-ALLOW-MORE-HANDLERS:CAPS"></a><span class="term"><code class="literal">LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS</code></span></p></td>
<td>Return to continue the calling handlers from the handler list. This declares that another handlers should handle the message.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="LmHandlerPriority"></a><h3>enum LmHandlerPriority</h3>
<pre class="programlisting">typedef enum {
LM_HANDLER_PRIORITY_LAST = 1,
LM_HANDLER_PRIORITY_NORMAL = 2,
LM_HANDLER_PRIORITY_FIRST = 3
} LmHandlerPriority;
</pre>
<p>
Since the handlers decide whether to stop the calling chain with there return values it's sometimes decirable to be able to set priority. For example a handler that only logs all incoming messages and then pass the message on to another handler wants to have priority <a class="link" href="loudmouth-lm-connection.html#LM-HANDLER-PRIORITY-FIRST:CAPS"><code class="literal">LM_HANDLER_PRIORITY_FIRST</code></a>. An handler that should take all messages that wasn't handled by anything else would want to have priority <a class="link" href="loudmouth-lm-connection.html#LM-HANDLER-PRIORITY-LAST:CAPS"><code class="literal">LM_HANDLER_PRIORITY_LAST</code></a>. If several handlers have the same priority nothing can be said about the order the handlers will be called in.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><a name="LM-HANDLER-PRIORITY-LAST:CAPS"></a><span class="term"><code class="literal">LM_HANDLER_PRIORITY_LAST</code></span></p></td>
<td>Call the handler after all handlers with <span class="type">NORMAL</span> and <span class="type">FIRST</span> priority.
</td>
</tr>
<tr>
<td><p><a name="LM-HANDLER-PRIORITY-NORMAL:CAPS"></a><span class="term"><code class="literal">LM_HANDLER_PRIORITY_NORMAL</code></span></p></td>
<td>Called before handlers with priority <span class="type">LAST</span> and after those with <span class="type">FIRST</span>.
</td>
</tr>
<tr>
<td><p><a name="LM-HANDLER-PRIORITY-FIRST:CAPS"></a><span class="term"><code class="literal">LM_HANDLER_PRIORITY_FIRST</code></span></p></td>
<td>These are called before all other handlers.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="LmDisconnectReason"></a><h3>enum LmDisconnectReason</h3>
<pre class="programlisting">typedef enum {
LM_DISCONNECT_REASON_OK,
LM_DISCONNECT_REASON_PING_TIME_OUT,
LM_DISCONNECT_REASON_HUP,
LM_DISCONNECT_REASON_ERROR,
LM_DISCONNECT_REASON_RESOURCE_CONFLICT,
LM_DISCONNECT_REASON_INVALID_XML,
LM_DISCONNECT_REASON_UNKNOWN
} LmDisconnectReason;
</pre>
<p>
Sent with <a class="link" href="loudmouth-lm-connection.html#LmDisconnectFunction" title="LmDisconnectFunction ()"><span class="type">LmDisconnectFunction</span></a> to describe why a connection was closed.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><a name="LM-DISCONNECT-REASON-OK:CAPS"></a><span class="term"><code class="literal">LM_DISCONNECT_REASON_OK</code></span></p></td>
<td>User requested disconnect.
</td>
</tr>
<tr>
<td><p><a name="LM-DISCONNECT-REASON-PING-TIME-OUT:CAPS"></a><span class="term"><code class="literal">LM_DISCONNECT_REASON_PING_TIME_OUT</code></span></p></td>
<td>Connection to the server timed out.
</td>
</tr>
<tr>
<td><p><a name="LM-DISCONNECT-REASON-HUP:CAPS"></a><span class="term"><code class="literal">LM_DISCONNECT_REASON_HUP</code></span></p></td>
<td>The socket emitted that the connection was hung up.
</td>
</tr>
<tr>
<td><p><a name="LM-DISCONNECT-REASON-ERROR:CAPS"></a><span class="term"><code class="literal">LM_DISCONNECT_REASON_ERROR</code></span></p></td>
<td>A generic error somewhere in the transport layer.
</td>
</tr>
<tr>
<td><p><a name="LM-DISCONNECT-REASON-RESOURCE-CONFLICT:CAPS"></a><span class="term"><code class="literal">LM_DISCONNECT_REASON_RESOURCE_CONFLICT</code></span></p></td>
<td>Another connection was made to the server with the same resource.
</td>
</tr>
<tr>
<td><p><a name="LM-DISCONNECT-REASON-INVALID-XML:CAPS"></a><span class="term"><code class="literal">LM_DISCONNECT_REASON_INVALID_XML</code></span></p></td>
<td>Invalid XML was sent from the client.
</td>
</tr>
<tr>
<td><p><a name="LM-DISCONNECT-REASON-UNKNOWN:CAPS"></a><span class="term"><code class="literal">LM_DISCONNECT_REASON_UNKNOWN</code></span></p></td>
<td>An unknown error.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="LmConnectionState"></a><h3>enum LmConnectionState</h3>
<pre class="programlisting">typedef enum {
LM_CONNECTION_STATE_CLOSED,
LM_CONNECTION_STATE_OPENING,
LM_CONNECTION_STATE_OPEN,
LM_CONNECTION_STATE_AUTHENTICATING,
LM_CONNECTION_STATE_AUTHENTICATED
} LmConnectionState;
</pre>
<p>
Describes the current state of an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><a name="LM-CONNECTION-STATE-CLOSED:CAPS"></a><span class="term"><code class="literal">LM_CONNECTION_STATE_CLOSED</code></span></p></td>
<td>The connection is closed.
</td>
</tr>
<tr>
<td><p><a name="LM-CONNECTION-STATE-OPENING:CAPS"></a><span class="term"><code class="literal">LM_CONNECTION_STATE_OPENING</code></span></p></td>
<td>The connection is in the process of opening.
</td>
</tr>
<tr>
<td><p><a name="LM-CONNECTION-STATE-OPEN:CAPS"></a><span class="term"><code class="literal">LM_CONNECTION_STATE_OPEN</code></span></p></td>
<td>The connection is open.
</td>
</tr>
<tr>
<td><p><a name="LM-CONNECTION-STATE-AUTHENTICATING:CAPS"></a><span class="term"><code class="literal">LM_CONNECTION_STATE_AUTHENTICATING</code></span></p></td>
<td>The connection is in the process of authenticating.
</td>
</tr>
<tr>
<td><p><a name="LM-CONNECTION-STATE-AUTHENTICATED:CAPS"></a><span class="term"><code class="literal">LM_CONNECTION_STATE_AUTHENTICATED</code></span></p></td>
<td>The connection is authenticated and is ready to start sending/receiving messages.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="LmResultFunction"></a><h3>LmResultFunction ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> (*LmResultFunction) (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> success</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
<p>
Callback for informing if an asynchronous operation was successful.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>success</code></em> :</span></p></td>
<td>the result, <code class="literal">TRUE</code> if operation succeeded, otherwise <code class="literal">FALSE</code>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>User data passed when function being called.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="LmDisconnectFunction"></a><h3>LmDisconnectFunction ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> (*LmDisconnectFunction) (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmDisconnectReason" title="enum LmDisconnectReason"><span class="type">LmDisconnectReason</span></a> reason</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
<p>
Callback called when a connection is closed.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>reason</code></em> :</span></p></td>
<td>the reason the connection was closed.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>User data passed when function being called.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-new"></a><h3>lm_connection_new ()</h3>
<pre class="programlisting"><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="returnvalue">LmConnection</span></a> * lm_connection_new (<em class="parameter"><code>const <span class="type">gchar</span> *server</code></em>);</pre>
<p>
Creates a new closed connection. To open the connection call
<a class="link" href="loudmouth-lm-connection.html#lm-connection-open" title="lm_connection_open ()"><code class="function">lm_connection_open()</code></a>. <em class="parameter"><code>server</code></em> can be <span class="type">NULL</span> but must be set before calling <a class="link" href="loudmouth-lm-connection.html#lm-connection-open" title="lm_connection_open ()"><code class="function">lm_connection_open()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>server</code></em> :</span></p></td>
<td>The hostname to the server for the connection.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly created LmConnection, should be unreffed with <a class="link" href="loudmouth-lm-connection.html#lm-connection-unref" title="lm_connection_unref ()"><code class="function">lm_connection_unref()</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-new-with-context"></a><h3>lm_connection_new_with_context ()</h3>
<pre class="programlisting"><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="returnvalue">LmConnection</span></a> * lm_connection_new_with_context (<em class="parameter"><code>const <span class="type">gchar</span> *server</code></em>,
<em class="parameter"><code><span class="type">GMainContext</span> *context</code></em>);</pre>
<p>
Creates a new closed connection running in a certain context. To open the
connection call <a class="link" href="loudmouth-lm-connection.html#lm-connection-open" title="lm_connection_open ()"><span class="type">lm_connection_open</span></a>. <em class="parameter"><code>server</code></em> can be <span class="type">NULL</span> but must be set
before calling <a class="link" href="loudmouth-lm-connection.html#lm-connection-open" title="lm_connection_open ()"><span class="type">lm_connection_open</span></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>server</code></em> :</span></p></td>
<td>The hostname to the server for the connection.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
<td>The context this connection should be running in.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly created LmConnection, should be unreffed with <a class="link" href="loudmouth-lm-connection.html#lm-connection-unref" title="lm_connection_unref ()"><code class="function">lm_connection_unref()</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-open"></a><h3>lm_connection_open ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> lm_connection_open (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmResultFunction" title="LmResultFunction ()"><span class="type">LmResultFunction</span></a> function</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> notify</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>
An async call to open <em class="parameter"><code>connection</code></em>. When the connection is open <em class="parameter"><code>function</code></em> will be called.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>
<a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> to open</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>Callback function that will be called when the connection is open.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>User data that will be passed to <em class="parameter"><code>function</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>notify</code></em> :</span></p></td>
<td>Function for freeing that user_data, can be NULL.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>location to store error, or <code class="literal">NULL</code>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<span class="type">TRUE</span> if everything went fine, otherwise <span class="type">FALSE</span>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-open-and-block"></a><h3>lm_connection_open_and_block ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> lm_connection_open_and_block (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>
Opens <em class="parameter"><code>connection</code></em> and waits until the stream is setup.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> to open</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>location to store error, or <code class="literal">NULL</code>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<span class="type">TRUE</span> if no errors where encountered during opening and stream setup successfully, <span class="type">FALSE</span> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-close"></a><h3>lm_connection_close ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> lm_connection_close (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>
A synchronous call to close the connection. When returning the connection is considered to be closed and can be opened again with <a class="link" href="loudmouth-lm-connection.html#lm-connection-open" title="lm_connection_open ()"><code class="function">lm_connection_open()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>
<a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> to close</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>location to store error, or <code class="literal">NULL</code>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Returns <span class="type">TRUE</span> if no errors where detected, otherwise <span class="type">FALSE</span>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-authenticate"></a><h3>lm_connection_authenticate ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> lm_connection_authenticate (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *username</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *password</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *resource</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmResultFunction" title="LmResultFunction ()"><span class="type">LmResultFunction</span></a> function</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> notify</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>
Tries to authenticate a user against the server. The <span class="type">LmResult</span> in the result callback <em class="parameter"><code>function</code></em> will say whether it succeeded or not.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>
<a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> to authenticate.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>username</code></em> :</span></p></td>
<td>Username used to authenticate.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
<td>Password corresponding to <em class="parameter"><code>username</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>resource</code></em> :</span></p></td>
<td>Resource used for this connection.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>Callback called when authentication is finished.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>Userdata passed to <em class="parameter"><code>function</code></em> when called.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>notify</code></em> :</span></p></td>
<td>Destroy function to free the memory used by <em class="parameter"><code>user_data</code></em>, can be NULL.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>location to store error, or <code class="literal">NULL</code>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<span class="type">TRUE</span> if no errors where detected while sending the authentication message, <span class="type">FALSE</span> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-authenticate-and-block"></a><h3>lm_connection_authenticate_and_block ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> lm_connection_authenticate_and_block
(<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *username</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *password</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *resource</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>
Tries to authenticate a user against the server. This function blocks until a reply to the authentication attempt is returned and returns whether it was successful or not.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>username</code></em> :</span></p></td>
<td>Username used to authenticate.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
<td>Password corresponding to <em class="parameter"><code>username</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>resource</code></em> :</span></p></td>
<td>Resource used for this connection.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>location to store error, or <code class="literal">NULL</code>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<span class="type">TRUE</span> if no errors where detected and authentication was successful. <span class="type">FALSE</span> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-get-keep-alive-rate"></a><h3>lm_connection_get_keep_alive_rate ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span> lm_connection_get_keep_alive_rate (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);</pre>
<p>
Get the keep alive rate, in seconds. Zero is returned if no keep alive rate has been set.
</p>
<p>
Since 1.4.0
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The keep alive rate in seconds.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-set-keep-alive-rate"></a><h3>lm_connection_set_keep_alive_rate ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> lm_connection_set_keep_alive_rate (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">guint</span> rate</code></em>);</pre>
<p>
Set the keep alive rate, in seconds. Set to 0 to prevent keep alive messages to be sent.
A keep alive message is a single space character.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>rate</code></em> :</span></p></td>
<td>Number of seconds between keep alive packages are sent.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-is-open"></a><h3>lm_connection_is_open ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> lm_connection_is_open (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);</pre>
<p>
Check if the <em class="parameter"><code>connection</code></em> is currently open.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>
<a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> to check if it is open.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<span class="type">TRUE</span> if connection is open and <span class="type">FALSE</span> if it is closed.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-is-authenticated"></a><h3>lm_connection_is_authenticated ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> lm_connection_is_authenticated (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);</pre>
<p>
Check if <em class="parameter"><code>connection</code></em> is authenticated.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>
<a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> to check if it is authenticated</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<span class="type">TRUE</span> if connection is authenticated, <span class="type">FALSE</span> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-get-server"></a><h3>lm_connection_get_server ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> * lm_connection_get_server (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);</pre>
<p>
Fetches the server address that <em class="parameter"><code>connection</code></em> is using.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the server address</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-set-server"></a><h3>lm_connection_set_server ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> lm_connection_set_server (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *server</code></em>);</pre>
<p>
Sets the server address for <em class="parameter"><code>connection</code></em> to <em class="parameter"><code>server</code></em>. Notice that <em class="parameter"><code>connection</code></em>
can't be open while doing this.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>server</code></em> :</span></p></td>
<td>Address of the server</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-get-jid"></a><h3>lm_connection_get_jid ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> * lm_connection_get_jid (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);</pre>
<p>
Fetches the jid set for <em class="parameter"><code>connection</code></em> is using.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the jid</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-set-jid"></a><h3>lm_connection_set_jid ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> lm_connection_set_jid (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *jid</code></em>);</pre>
<p>
Sets the JID to be used for <em class="parameter"><code>connection</code></em>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>jid</code></em> :</span></p></td>
<td>JID to be used for <em class="parameter"><code>connection</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-get-port"></a><h3>lm_connection_get_port ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span> lm_connection_get_port (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);</pre>
<p>
Fetches the port that <em class="parameter"><code>connection</code></em> is using.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The port used.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-set-port"></a><h3>lm_connection_set_port ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> lm_connection_set_port (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">guint</span> port</code></em>);</pre>
<p>
Sets the server port that <em class="parameter"><code>connection</code></em> will be using.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>port</code></em> :</span></p></td>
<td>server port</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-get-ssl"></a><h3>lm_connection_get_ssl ()</h3>
<pre class="programlisting"><a class="link" href="loudmouth-lm-ssl.html#LmSSL" title="LmSSL"><span class="returnvalue">LmSSL</span></a> * lm_connection_get_ssl (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);</pre>
<p>
Returns the SSL struct if the connection is using one.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The ssl struct or <code class="literal">NULL</code> if no proxy is used.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-set-ssl"></a><h3>lm_connection_set_ssl ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> lm_connection_set_ssl (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-ssl.html#LmSSL" title="LmSSL"><span class="type">LmSSL</span></a> *ssl</code></em>);</pre>
<p>
Sets SSL struct or unset if <em class="parameter"><code>ssl</code></em> is <code class="literal">NULL</code>. If set <em class="parameter"><code>connection</code></em> will use SSL to for the connection.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>An <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ssl</code></em> :</span></p></td>
<td>An <a class="link" href="loudmouth-lm-ssl.html#LmSSL" title="LmSSL"><span class="type">LmSSL</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-get-proxy"></a><h3>lm_connection_get_proxy ()</h3>
<pre class="programlisting"><a class="link" href="loudmouth-lm-proxy.html#LmProxy" title="LmProxy"><span class="returnvalue">LmProxy</span></a> * lm_connection_get_proxy (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);</pre>
<p>
Returns the proxy if the connection is using one.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The proxy or <code class="literal">NULL</code> if no proxy is used.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-set-proxy"></a><h3>lm_connection_set_proxy ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> lm_connection_set_proxy (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-proxy.html#LmProxy" title="LmProxy"><span class="type">LmProxy</span></a> *proxy</code></em>);</pre>
<p>
Sets the proxy to use for this connection. To unset pass <span class="type">NULL</span>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>proxy</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-proxy.html#LmProxy" title="LmProxy"><span class="type">LmProxy</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-send"></a><h3>lm_connection_send ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> lm_connection_send (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-message.html#LmMessage" title="LmMessage"><span class="type">LmMessage</span></a> *message</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>
Asynchronous call to send a message.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>
<a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> to send message over.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
<td>
<a class="link" href="loudmouth-lm-message.html#LmMessage" title="LmMessage"><span class="type">LmMessage</span></a> to send.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>location to store error, or <code class="literal">NULL</code>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Returns <span class="type">TRUE</span> if no errors where detected while sending, <span class="type">FALSE</span> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-send-with-reply"></a><h3>lm_connection_send_with_reply ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> lm_connection_send_with_reply (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-message.html#LmMessage" title="LmMessage"><span class="type">LmMessage</span></a> *message</code></em>,
<em class="parameter"><code><span class="type">LmMessageHandler</span> *handler</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>
Send a <a class="link" href="loudmouth-lm-message.html#LmMessage" title="LmMessage"><span class="type">LmMessage</span></a> which will result in a reply.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>
<a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> used to send message.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
<td>
<a class="link" href="loudmouth-lm-message.html#LmMessage" title="LmMessage"><span class="type">LmMessage</span></a> to send.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>handler</code></em> :</span></p></td>
<td>
<span class="type">LmMessageHandler</span> that will be used when a reply to <em class="parameter"><code>message</code></em> arrives</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>location to store error, or <code class="literal">NULL</code>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Returns <span class="type">TRUE</span> if no errors where detected while sending, <span class="type">FALSE</span> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-send-with-reply-and-block"></a><h3>lm_connection_send_with_reply_and_block ()</h3>
<pre class="programlisting"><a class="link" href="loudmouth-lm-message.html#LmMessage" title="LmMessage"><span class="returnvalue">LmMessage</span></a> * lm_connection_send_with_reply_and_block
(<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-message.html#LmMessage" title="LmMessage"><span class="type">LmMessage</span></a> *message</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>
Send <em class="parameter"><code>message</code></em> and wait for return.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
<td>an <a class="link" href="loudmouth-lm-message.html#LmMessage" title="LmMessage"><span class="type">LmMessage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>Set if error was detected during sending.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The reply</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-register-message-handler"></a><h3>lm_connection_register_message_handler ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> lm_connection_register_message_handler
(<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">LmMessageHandler</span> *handler</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-message.html#LmMessageType" title="enum LmMessageType"><span class="type">LmMessageType</span></a> type</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmHandlerPriority" title="enum LmHandlerPriority"><span class="type">LmHandlerPriority</span></a> priority</code></em>);</pre>
<p>
Registers a <span class="type">LmMessageHandler</span> to handle incoming messages of a certain type.
To unregister the handler call <a class="link" href="loudmouth-lm-connection.html#lm-connection-unregister-message-handler" title="lm_connection_unregister_message_handler ()"><code class="function">lm_connection_unregister_message_handler()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>Connection to register a handler for.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>handler</code></em> :</span></p></td>
<td>Message handler to register.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>Message type that <em class="parameter"><code>handler</code></em> will handle.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>priority</code></em> :</span></p></td>
<td>The priority in which to call <em class="parameter"><code>handler</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-unregister-message-handler"></a><h3>lm_connection_unregister_message_handler ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> lm_connection_unregister_message_handler
(<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><span class="type">LmMessageHandler</span> *handler</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-message.html#LmMessageType" title="enum LmMessageType"><span class="type">LmMessageType</span></a> type</code></em>);</pre>
<p>
Unregisters a handler for <em class="parameter"><code>connection</code></em>. <em class="parameter"><code>handler</code></em> will no longer be called
when incoming messages of <em class="parameter"><code>type</code></em> arrive.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>Connection to unregister a handler for.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>handler</code></em> :</span></p></td>
<td>The handler to unregister.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>What type of messages to unregister this handler for.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-set-disconnect-function"></a><h3>lm_connection_set_disconnect_function ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> lm_connection_set_disconnect_function
(<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmDisconnectFunction" title="LmDisconnectFunction ()"><span class="type">LmDisconnectFunction</span></a> function</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> notify</code></em>);</pre>
<p>
Set the callback that will be called when a connection is closed.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>Connection to register disconnect callback for.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>Function to be called when <em class="parameter"><code>connection</code></em> is closed.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>User data passed to <em class="parameter"><code>function</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>notify</code></em> :</span></p></td>
<td>Function that will be called with <em class="parameter"><code>user_data</code></em> when <em class="parameter"><code>user_data</code></em> needs to be freed. Pass <span class="type">NULL</span> if it shouldn't be freed.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-send-raw"></a><h3>lm_connection_send_raw ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> lm_connection_send_raw (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *str</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>
Asynchronous call to send a raw string. Useful for debugging and testing.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>Connection used to send</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td>
<td>The string to send, the entire string will be sent.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>Set if error was detected during sending.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Returns <span class="type">TRUE</span> if no errors was detected during sending,
<span class="type">FALSE</span> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-get-state"></a><h3>lm_connection_get_state ()</h3>
<pre class="programlisting"><a class="link" href="loudmouth-lm-connection.html#LmConnectionState" title="enum LmConnectionState"><span class="returnvalue">LmConnectionState</span></a> lm_connection_get_state (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);</pre>
<p>
Returns the state of the connection.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>Connection to get state on</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The state of the connection.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-ref"></a><h3>lm_connection_ref ()</h3>
<pre class="programlisting"><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="returnvalue">LmConnection</span></a> * lm_connection_ref (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);</pre>
<p>
Add a reference on <em class="parameter"><code>connection</code></em>. To remove a reference call
<a class="link" href="loudmouth-lm-connection.html#lm-connection-unref" title="lm_connection_unref ()"><code class="function">lm_connection_unref()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>Connection to add a reference to.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Returns the same connection.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="lm-connection-unref"></a><h3>lm_connection_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> lm_connection_unref (<em class="parameter"><code><a class="link" href="loudmouth-lm-connection.html#LmConnection" title="LmConnection"><span class="type">LmConnection</span></a> *connection</code></em>);</pre>
<p>
Removes a reference on <em class="parameter"><code>connection</code></em>. If there are no references to
<em class="parameter"><code>connection</code></em> it will be freed and shouldn't be used again.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>Connection to remove reference from.</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.19</div>
</body>
</html>
|