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
|
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="SoupSocket">
<refmeta>
<refentrytitle role="top_of_page">SoupSocket</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBSOUP Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>SoupSocket</refname>
<refpurpose>a network socket</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>
<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>
<synopsis>
struct <link linkend="SoupSocket-struct">SoupSocket</link>;
<link linkend="SoupSocket">SoupSocket</link>* <link linkend="soup-socket-new">soup_socket_new</link> (const <link linkend="char">char</link> *optname1,
...);
<link linkend="guint">guint</link> <link linkend="soup-socket-connect">soup_socket_connect</link> (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="SoupAddress">SoupAddress</link> *remote_addr);
<link linkend="gboolean">gboolean</link> <link linkend="soup-socket-listen">soup_socket_listen</link> (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="SoupAddress">SoupAddress</link> *local_addr);
<link linkend="gboolean">gboolean</link> <link linkend="soup-socket-start-ssl">soup_socket_start_ssl</link> (<link linkend="SoupSocket">SoupSocket</link> *sock);
<link linkend="gboolean">gboolean</link> <link linkend="soup-socket-start-proxy-ssl">soup_socket_start_proxy_ssl</link> (<link linkend="SoupSocket">SoupSocket</link> *sock,
const <link linkend="char">char</link> *ssl_host);
<link linkend="void">void</link> <link linkend="soup-socket-disconnect">soup_socket_disconnect</link> (<link linkend="SoupSocket">SoupSocket</link> *sock);
<link linkend="gboolean">gboolean</link> <link linkend="soup-socket-is-connected">soup_socket_is_connected</link> (<link linkend="SoupSocket">SoupSocket</link> *sock);
<link linkend="void">void</link> (<link linkend="SoupSocketCallback">*SoupSocketCallback</link>) (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="guint">guint</link> status,
<link linkend="gpointer">gpointer</link> user_data);
<link linkend="void">void</link> (<link linkend="SoupSocketListenerCallback">*SoupSocketListenerCallback</link>) (<link linkend="SoupSocket">SoupSocket</link> *listener,
<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gpointer">gpointer</link> user_data);
<link linkend="SoupSocket">SoupSocket</link>* <link linkend="soup-socket-client-new-async">soup_socket_client_new_async</link> (const <link linkend="char">char</link> *hostname,
<link linkend="guint">guint</link> port,
<link linkend="gpointer">gpointer</link> ssl_creds,
<link linkend="SoupSocketCallback">SoupSocketCallback</link> callback,
<link linkend="gpointer">gpointer</link> user_data);
<link linkend="SoupSocket">SoupSocket</link>* <link linkend="soup-socket-client-new-sync">soup_socket_client_new_sync</link> (const <link linkend="char">char</link> *hostname,
<link linkend="guint">guint</link> port,
<link linkend="gpointer">gpointer</link> ssl_creds,
<link linkend="guint">guint</link> *status_ret);
<link linkend="SoupSocket">SoupSocket</link>* <link linkend="soup-socket-server-new">soup_socket_server_new</link> (<link linkend="SoupAddress">SoupAddress</link> *local_addr,
<link linkend="gpointer">gpointer</link> ssl_creds,
<link linkend="SoupSocketListenerCallback">SoupSocketListenerCallback</link> callback,
<link linkend="gpointer">gpointer</link> user_data);
<link linkend="SoupAddress">SoupAddress</link>* <link linkend="soup-socket-get-local-address">soup_socket_get_local_address</link> (<link linkend="SoupSocket">SoupSocket</link> *sock);
<link linkend="SoupAddress">SoupAddress</link>* <link linkend="soup-socket-get-remote-address">soup_socket_get_remote_address</link> (<link linkend="SoupSocket">SoupSocket</link> *sock);
enum <link linkend="SoupSocketIOStatus">SoupSocketIOStatus</link>;
<link linkend="SoupSocketIOStatus">SoupSocketIOStatus</link> <link linkend="soup-socket-read">soup_socket_read</link> (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gpointer">gpointer</link> buffer,
<link linkend="gsize">gsize</link> len,
<link linkend="gsize">gsize</link> *nread);
<link linkend="SoupSocketIOStatus">SoupSocketIOStatus</link> <link linkend="soup-socket-read-until">soup_socket_read_until</link> (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gpointer">gpointer</link> buffer,
<link linkend="gsize">gsize</link> len,
<link linkend="gconstpointer">gconstpointer</link> boundary,
<link linkend="gsize">gsize</link> boundary_len,
<link linkend="gsize">gsize</link> *nread,
<link linkend="gboolean">gboolean</link> *got_boundary);
<link linkend="SoupSocketIOStatus">SoupSocketIOStatus</link> <link linkend="soup-socket-write">soup_socket_write</link> (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gconstpointer">gconstpointer</link> buffer,
<link linkend="gsize">gsize</link> len,
<link linkend="gsize">gsize</link> *nwrote);
#define <link linkend="SOUP-SOCKET-FLAG-NONBLOCKING:CAPS">SOUP_SOCKET_FLAG_NONBLOCKING</link>
#define <link linkend="SOUP-SOCKET-FLAG-NODELAY:CAPS">SOUP_SOCKET_FLAG_NODELAY</link>
#define <link linkend="SOUP-SOCKET-FLAG-REUSEADDR:CAPS">SOUP_SOCKET_FLAG_REUSEADDR</link>
#define <link linkend="SOUP-SOCKET-FLAG-CLOEXEC:CAPS">SOUP_SOCKET_FLAG_CLOEXEC</link>
#define <link linkend="SOUP-SOCKET-TIMEOUT:CAPS">SOUP_SOCKET_TIMEOUT</link>
#define <link linkend="SOUP-SOCKET-IS-SERVER:CAPS">SOUP_SOCKET_IS_SERVER</link>
#define <link linkend="SOUP-SOCKET-SSL-CREDENTIALS:CAPS">SOUP_SOCKET_SSL_CREDENTIALS</link>
#define <link linkend="SOUP-SOCKET-ASYNC-CONTEXT:CAPS">SOUP_SOCKET_ASYNC_CONTEXT</link>
</synopsis>
</refsynopsisdiv>
<refsect1 role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
<link linkend="GObject">GObject</link>
+----SoupSocket
</synopsis>
</refsect1>
<refsect1 role="properties">
<title role="properties.title">Properties</title>
<synopsis>
"<link linkend="SoupSocket--async-context">async-context</link>" <link linkend="gpointer">gpointer</link> : Read / Write / Construct Only
"<link linkend="SoupSocket--cloexec">cloexec</link>" <link linkend="gboolean">gboolean</link> : Read / Write
"<link linkend="SoupSocket--is-server">is-server</link>" <link linkend="gboolean">gboolean</link> : Read
"<link linkend="SoupSocket--nodelay">nodelay</link>" <link linkend="gboolean">gboolean</link> : Read / Write
"<link linkend="SoupSocket--non-blocking">non-blocking</link>" <link linkend="gboolean">gboolean</link> : Read / Write
"<link linkend="SoupSocket--reuseaddr">reuseaddr</link>" <link linkend="gboolean">gboolean</link> : Read / Write
"<link linkend="SoupSocket--ssl-creds">ssl-creds</link>" <link linkend="gpointer">gpointer</link> : Read / Write
"<link linkend="SoupSocket--timeout">timeout</link>" <link linkend="guint">guint</link> : Read / Write
</synopsis>
</refsect1>
<refsect1 role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
"<link linkend="SoupSocket-connect-result">connect-result</link>"
<link linkend="void">void</link> user_function (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gint">gint</link> status,
<link linkend="gpointer">gpointer</link> user_data) : Run first
"<link linkend="SoupSocket-disconnected">disconnected</link>"
<link linkend="void">void</link> user_function (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gpointer">gpointer</link> user_data) : Run last
"<link linkend="SoupSocket-new-connection">new-connection</link>"
<link linkend="void">void</link> user_function (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="SoupSocket">SoupSocket</link> *new,
<link linkend="gpointer">gpointer</link> user_data) : Run first
"<link linkend="SoupSocket-readable">readable</link>" <link linkend="void">void</link> user_function (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gpointer">gpointer</link> user_data) : Run last
"<link linkend="SoupSocket-writable">writable</link>" <link linkend="void">void</link> user_function (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gpointer">gpointer</link> user_data) : Run last
</synopsis>
</refsect1>
<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
</para>
</refsect1>
<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="SoupSocket-struct" role="struct"/>struct SoupSocket</title>
<indexterm><primary>SoupSocket</primary></indexterm><programlisting>struct SoupSocket;</programlisting>
<para>
</para></refsect2>
<refsect2>
<title><anchor id="soup-socket-new" role="function"/>soup_socket_new ()</title>
<indexterm><primary>soup_socket_new</primary></indexterm><programlisting><link linkend="SoupSocket">SoupSocket</link>* soup_socket_new (const <link linkend="char">char</link> *optname1,
...);</programlisting>
<para>
Creates a new (disconnected) socket</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>optname1</parameter> :</term>
<listitem><simpara> name of first property to set (or <link linkend="NULL:CAPS"><literal>NULL</literal></link>)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter> :</term>
<listitem><simpara> value of <parameter>optname1</parameter>, followed by additional property/value pairs
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new socket
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-connect" role="function"/>soup_socket_connect ()</title>
<indexterm><primary>soup_socket_connect</primary></indexterm><programlisting><link linkend="guint">guint</link> soup_socket_connect (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="SoupAddress">SoupAddress</link> *remote_addr);</programlisting>
<para>
If <link linkend="SOUP-SOCKET-FLAG-NONBLOCKING:CAPS"><literal>SOUP_SOCKET_FLAG_NONBLOCKING</literal></link> has been set on the socket, this
begins asynchronously connecting to the given address. The socket
will emit <link linkend="connect-result"><literal>connect_result</literal></link> when it succeeds or fails (but not before
returning from this function).
</para>
<para>
If <link linkend="SOUP-SOCKET-FLAG-NONBLOCKING:CAPS"><literal>SOUP_SOCKET_FLAG_NONBLOCKING</literal></link> has not been set, this will
attempt to synchronously connect.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> a client <link linkend="SoupSocket"><type>SoupSocket</type></link> (which must not already be connected)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>remote_addr</parameter> :</term>
<listitem><simpara> address to connect to
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="SOUP-STATUS-CONTINUE:CAPS"><literal>SOUP_STATUS_CONTINUE</literal></link> if connecting asynchronously,
otherwise a success or failure code.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-listen" role="function"/>soup_socket_listen ()</title>
<indexterm><primary>soup_socket_listen</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> soup_socket_listen (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="SoupAddress">SoupAddress</link> *local_addr);</programlisting>
<para>
Makes <parameter>sock</parameter> start listening on the given interface and port. When
connections come in, <parameter>sock</parameter> will emit <link linkend="new-connection"><literal>new_connection</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> a server <link linkend="SoupSocket"><type>SoupSocket</type></link> (which must not already be connected or
listening)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>local_addr</parameter> :</term>
<listitem><simpara> Local address to bind to.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> whether or not <parameter>sock</parameter> is now listening.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-start-ssl" role="function"/>soup_socket_start_ssl ()</title>
<indexterm><primary>soup_socket_start_ssl</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> soup_socket_start_ssl (<link linkend="SoupSocket">SoupSocket</link> *sock);</programlisting>
<para>
Starts using SSL on <parameter>socket</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> the socket
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> success or failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-start-proxy-ssl" role="function"/>soup_socket_start_proxy_ssl ()</title>
<indexterm><primary>soup_socket_start_proxy_ssl</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> soup_socket_start_proxy_ssl (<link linkend="SoupSocket">SoupSocket</link> *sock,
const <link linkend="char">char</link> *ssl_host);</programlisting>
<para>
Starts using SSL on <parameter>socket</parameter>, expecting to find a host named
<parameter>ssl_host</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> the socket
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ssl_host</parameter> :</term>
<listitem><simpara> hostname of the SSL server
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> success or failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-disconnect" role="function"/>soup_socket_disconnect ()</title>
<indexterm><primary>soup_socket_disconnect</primary></indexterm><programlisting><link linkend="void">void</link> soup_socket_disconnect (<link linkend="SoupSocket">SoupSocket</link> *sock);</programlisting>
<para>
Disconnects <parameter>sock</parameter>. Any further read or write attempts on it will
fail.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> a <link linkend="SoupSocket"><type>SoupSocket</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-is-connected" role="function"/>soup_socket_is_connected ()</title>
<indexterm><primary>soup_socket_is_connected</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> soup_socket_is_connected (<link linkend="SoupSocket">SoupSocket</link> *sock);</programlisting>
<para>
Tests if <parameter>sock</parameter> is connected to another host</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> a <link linkend="SoupSocket"><type>SoupSocket</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="SoupSocketCallback" role="function"/>SoupSocketCallback ()</title>
<indexterm><primary>SoupSocketCallback</primary></indexterm><programlisting><link linkend="void">void</link> (*SoupSocketCallback) (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="guint">guint</link> status,
<link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
The callback function passed to <link linkend="soup-socket-client-new-async"><function>soup_socket_client_new_async()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> the <link linkend="SoupSocket"><type>SoupSocket</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara> an HTTP status code indicating success or failure
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara> the data passed to <link linkend="soup-socket-client-new-async"><function>soup_socket_client_new_async()</function></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="SoupSocketListenerCallback" role="function"/>SoupSocketListenerCallback ()</title>
<indexterm><primary>SoupSocketListenerCallback</primary></indexterm><programlisting><link linkend="void">void</link> (*SoupSocketListenerCallback) (<link linkend="SoupSocket">SoupSocket</link> *listener,
<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
The callback function passed to <link linkend="soup-socket-server-new"><function>soup_socket_server_new()</function></link>, which
receives new connections.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>listener</parameter> :</term>
<listitem><simpara> the listening <link linkend="SoupSocket"><type>SoupSocket</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> the newly-received <link linkend="SoupSocket"><type>SoupSocket</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara> the data passed to <link linkend="soup-socket-server-new"><function>soup_socket_server_new()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-client-new-async" role="function"/>soup_socket_client_new_async ()</title>
<indexterm><primary>soup_socket_client_new_async</primary></indexterm><programlisting><link linkend="SoupSocket">SoupSocket</link>* soup_socket_client_new_async (const <link linkend="char">char</link> *hostname,
<link linkend="guint">guint</link> port,
<link linkend="gpointer">gpointer</link> ssl_creds,
<link linkend="SoupSocketCallback">SoupSocketCallback</link> callback,
<link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Creates a connection to <parameter>hostname</parameter> and <parameter>port</parameter>. <parameter>callback</parameter> will be
called when the connection completes (or fails).
</para>
<para>
Uses the default <link linkend="GMainContext"><type>GMainContext</type></link>. If you need to use an alternate
context, use <link linkend="soup-socket-new"><function>soup_socket_new()</function></link> and <link linkend="soup-socket-connect"><function>soup_socket_connect()</function></link> directly.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>hostname</parameter> :</term>
<listitem><simpara> remote machine to connect to
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>port</parameter> :</term>
<listitem><simpara> remote port to connect to
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ssl_creds</parameter> :</term>
<listitem><simpara> SSL credentials structure, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if not SSL
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter> :</term>
<listitem><simpara> callback to call when the socket is connected
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara> data for <parameter>callback</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new socket (not yet ready for use).
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-client-new-sync" role="function"/>soup_socket_client_new_sync ()</title>
<indexterm><primary>soup_socket_client_new_sync</primary></indexterm><programlisting><link linkend="SoupSocket">SoupSocket</link>* soup_socket_client_new_sync (const <link linkend="char">char</link> *hostname,
<link linkend="guint">guint</link> port,
<link linkend="gpointer">gpointer</link> ssl_creds,
<link linkend="guint">guint</link> *status_ret);</programlisting>
<para>
Creates a connection to <parameter>hostname</parameter> and <parameter>port</parameter>. If <parameter>status_ret</parameter> is not
<link linkend="NULL:CAPS"><literal>NULL</literal></link>, it will contain a status code on return.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>hostname</parameter> :</term>
<listitem><simpara> remote machine to connect to
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>port</parameter> :</term>
<listitem><simpara> remote port to connect to
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ssl_creds</parameter> :</term>
<listitem><simpara> SSL credentials structure, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if not SSL
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status_ret</parameter> :</term>
<listitem><simpara> pointer to return the soup status in
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new socket, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if it could not connect.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-server-new" role="function"/>soup_socket_server_new ()</title>
<indexterm><primary>soup_socket_server_new</primary></indexterm><programlisting><link linkend="SoupSocket">SoupSocket</link>* soup_socket_server_new (<link linkend="SoupAddress">SoupAddress</link> *local_addr,
<link linkend="gpointer">gpointer</link> ssl_creds,
<link linkend="SoupSocketListenerCallback">SoupSocketListenerCallback</link> callback,
<link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Create and open a new <link linkend="SoupSocket"><type>SoupSocket</type></link> listening on the specified
address. <parameter>callback</parameter> will be called each time a client connects,
with a new <link linkend="SoupSocket"><type>SoupSocket</type></link>.
</para>
<para>
Uses the default <link linkend="GMainContext"><type>GMainContext</type></link>. If you need to use an alternate
context, use <link linkend="soup-socket-new"><function>soup_socket_new()</function></link> and <link linkend="soup-socket-listen"><function>soup_socket_listen()</function></link> directly.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>local_addr</parameter> :</term>
<listitem><simpara> Local address to bind to. (Use <link linkend="soup-address-any-new"><function>soup_address_any_new()</function></link> to
accept connections on any local address)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ssl_creds</parameter> :</term>
<listitem><simpara> SSL credentials, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if this is not an SSL server
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter> :</term>
<listitem><simpara> Callback to call when a client connects
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara> data to pass to <parameter>callback</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a new <link linkend="SoupSocket"><type>SoupSocket</type></link>, or NULL if there was a failure.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-get-local-address" role="function"/>soup_socket_get_local_address ()</title>
<indexterm><primary>soup_socket_get_local_address</primary></indexterm><programlisting><link linkend="SoupAddress">SoupAddress</link>* soup_socket_get_local_address (<link linkend="SoupSocket">SoupSocket</link> *sock);</programlisting>
<para>
Returns the <link linkend="SoupAddress"><type>SoupAddress</type></link> corresponding to the local end of <parameter>sock</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> a <link linkend="SoupSocket"><type>SoupSocket</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the <link linkend="SoupAddress"><type>SoupAddress</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-get-remote-address" role="function"/>soup_socket_get_remote_address ()</title>
<indexterm><primary>soup_socket_get_remote_address</primary></indexterm><programlisting><link linkend="SoupAddress">SoupAddress</link>* soup_socket_get_remote_address (<link linkend="SoupSocket">SoupSocket</link> *sock);</programlisting>
<para>
Returns the <link linkend="SoupAddress"><type>SoupAddress</type></link> corresponding to the remote end of <parameter>sock</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> a <link linkend="SoupSocket"><type>SoupSocket</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the <link linkend="SoupAddress"><type>SoupAddress</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="SoupSocketIOStatus" role="enum"/>enum SoupSocketIOStatus</title>
<indexterm><primary>SoupSocketIOStatus</primary></indexterm><programlisting>typedef enum {
SOUP_SOCKET_OK,
SOUP_SOCKET_WOULD_BLOCK,
SOUP_SOCKET_EOF,
SOUP_SOCKET_ERROR
} SoupSocketIOStatus;
</programlisting>
<para>
Return value from the <link linkend="SoupSocket"><type>SoupSocket</type></link> IO methods.</para>
<para>
</para><variablelist role="enum">
<varlistentry>
<term><anchor id="SOUP-SOCKET-OK:CAPS" role="constant"/><literal>SOUP_SOCKET_OK</literal></term>
<listitem><simpara> Success
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="SOUP-SOCKET-WOULD-BLOCK:CAPS" role="constant"/><literal>SOUP_SOCKET_WOULD_BLOCK</literal></term>
<listitem><simpara> Cannot read/write any more at this time
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="SOUP-SOCKET-EOF:CAPS" role="constant"/><literal>SOUP_SOCKET_EOF</literal></term>
<listitem><simpara> End of file
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="SOUP-SOCKET-ERROR:CAPS" role="constant"/><literal>SOUP_SOCKET_ERROR</literal></term>
<listitem><simpara> Other error
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-read" role="function"/>soup_socket_read ()</title>
<indexterm><primary>soup_socket_read</primary></indexterm><programlisting><link linkend="SoupSocketIOStatus">SoupSocketIOStatus</link> soup_socket_read (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gpointer">gpointer</link> buffer,
<link linkend="gsize">gsize</link> len,
<link linkend="gsize">gsize</link> *nread);</programlisting>
<para>
Attempts to read up to <parameter>len</parameter> bytes from <parameter>sock</parameter> into <parameter>buffer</parameter>. If some
data is successfully read, <link linkend="soup-socket-read"><function>soup_socket_read()</function></link> will return
<link linkend="SOUP-SOCKET-OK:CAPS"><literal>SOUP_SOCKET_OK</literal></link>, and *<parameter>nread</parameter> will contain the number of bytes
actually read.
</para>
<para>
If <parameter>sock</parameter> is non-blocking, and no data is available, the return
value will be <link linkend="SOUP-SOCKET-WOULD-BLOCK:CAPS"><literal>SOUP_SOCKET_WOULD_BLOCK</literal></link>. In this case, the caller
can connect to the <link linkend="readable"><literal>readable</literal></link> signal to know when there is more data
to read. (NB: You MUST read all available data off the socket
first. The <link linkend="readable"><literal>readable</literal></link> signal will only be emitted after
<link linkend="soup-socket-read"><function>soup_socket_read()</function></link> has returned <link linkend="SOUP-SOCKET-WOULD-BLOCK:CAPS"><literal>SOUP_SOCKET_WOULD_BLOCK</literal></link>.)</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> the socket
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buffer</parameter> :</term>
<listitem><simpara> buffer to read into
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter> :</term>
<listitem><simpara> size of <parameter>buffer</parameter> in bytes
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>nread</parameter> :</term>
<listitem><simpara> on return, the number of bytes read into <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="SoupSocketIOStatus"><type>SoupSocketIOStatus</type></link>, as described above (or
<link linkend="SOUP-SOCKET-EOF:CAPS"><literal>SOUP_SOCKET_EOF</literal></link> if the socket is no longer connected, or
<link linkend="SOUP-SOCKET-ERROR:CAPS"><literal>SOUP_SOCKET_ERROR</literal></link> on any other error).
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-read-until" role="function"/>soup_socket_read_until ()</title>
<indexterm><primary>soup_socket_read_until</primary></indexterm><programlisting><link linkend="SoupSocketIOStatus">SoupSocketIOStatus</link> soup_socket_read_until (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gpointer">gpointer</link> buffer,
<link linkend="gsize">gsize</link> len,
<link linkend="gconstpointer">gconstpointer</link> boundary,
<link linkend="gsize">gsize</link> boundary_len,
<link linkend="gsize">gsize</link> *nread,
<link linkend="gboolean">gboolean</link> *got_boundary);</programlisting>
<para>
Like <link linkend="soup-socket-read"><function>soup_socket_read()</function></link>, but reads no further than the first
occurrence of <parameter>boundary</parameter>. (If the boundary is found, it will be
included in the returned data, and *<parameter>got_boundary</parameter> will be set to
<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>.) Any data after the boundary will returned in future reads.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> the socket
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buffer</parameter> :</term>
<listitem><simpara> buffer to read into
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter> :</term>
<listitem><simpara> size of <parameter>buffer</parameter> in bytes
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>boundary</parameter> :</term>
<listitem><simpara> boundary to read until
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>boundary_len</parameter> :</term>
<listitem><simpara> length of <parameter>boundary</parameter> in bytes
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>nread</parameter> :</term>
<listitem><simpara> on return, the number of bytes read into <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>got_boundary</parameter> :</term>
<listitem><simpara> on return, whether or not the data in <parameter>buffer</parameter>
ends with the boundary string
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> as for <link linkend="soup-socket-read"><function>soup_socket_read()</function></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="soup-socket-write" role="function"/>soup_socket_write ()</title>
<indexterm><primary>soup_socket_write</primary></indexterm><programlisting><link linkend="SoupSocketIOStatus">SoupSocketIOStatus</link> soup_socket_write (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gconstpointer">gconstpointer</link> buffer,
<link linkend="gsize">gsize</link> len,
<link linkend="gsize">gsize</link> *nwrote);</programlisting>
<para>
Attempts to write <parameter>len</parameter> bytes from <parameter>buffer</parameter> to <parameter>sock</parameter>. If some data is
successfully written, the resturn status will be
<link linkend="SOUP-SOCKET-SUCCESS:CAPS"><literal>SOUP_SOCKET_SUCCESS</literal></link>, and *<parameter>nwrote</parameter> will contain the number of bytes
actually written.
</para>
<para>
If <parameter>sock</parameter> is non-blocking, and no data could be written right away,
the return value will be <link linkend="SOUP-SOCKET-WOULD-BLOCK:CAPS"><literal>SOUP_SOCKET_WOULD_BLOCK</literal></link>. In this case,
the caller can connect to the <link linkend="writable"><literal>writable</literal></link> signal to know when more
data can be written. (NB: <link linkend="writable"><literal>writable</literal></link> is only emitted after a
<link linkend="SOUP-SOCKET-WOULD-BLOCK:CAPS"><literal>SOUP_SOCKET_WOULD_BLOCK</literal></link>.)</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> the socket
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buffer</parameter> :</term>
<listitem><simpara> data to write
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter> :</term>
<listitem><simpara> size of <parameter>buffer</parameter>, in bytes
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>nwrote</parameter> :</term>
<listitem><simpara> on return, number of bytes written
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="SoupSocketIOStatus"><type>SoupSocketIOStatus</type></link>, as described above (or
<link linkend="SOUP-SOCKET-EOF:CAPS"><literal>SOUP_SOCKET_EOF</literal></link> or <link linkend="SOUP-SOCKET-ERROR:CAPS"><literal>SOUP_SOCKET_ERROR</literal></link>).
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="SOUP-SOCKET-FLAG-NONBLOCKING:CAPS" role="macro"/>SOUP_SOCKET_FLAG_NONBLOCKING</title>
<indexterm><primary>SOUP_SOCKET_FLAG_NONBLOCKING</primary></indexterm><programlisting>#define SOUP_SOCKET_FLAG_NONBLOCKING "non-blocking"
</programlisting>
<para>
An alias for the "non-blocking" property.
</para></refsect2>
<refsect2>
<title><anchor id="SOUP-SOCKET-FLAG-NODELAY:CAPS" role="macro"/>SOUP_SOCKET_FLAG_NODELAY</title>
<indexterm><primary>SOUP_SOCKET_FLAG_NODELAY</primary></indexterm><programlisting>#define SOUP_SOCKET_FLAG_NODELAY "nodelay"
</programlisting>
<para>
An alias for the "nodelay" property.
</para></refsect2>
<refsect2>
<title><anchor id="SOUP-SOCKET-FLAG-REUSEADDR:CAPS" role="macro"/>SOUP_SOCKET_FLAG_REUSEADDR</title>
<indexterm><primary>SOUP_SOCKET_FLAG_REUSEADDR</primary></indexterm><programlisting>#define SOUP_SOCKET_FLAG_REUSEADDR "reuseaddr"
</programlisting>
<para>
An alias for the "reuseaddr" property.
</para></refsect2>
<refsect2>
<title><anchor id="SOUP-SOCKET-FLAG-CLOEXEC:CAPS" role="macro"/>SOUP_SOCKET_FLAG_CLOEXEC</title>
<indexterm><primary>SOUP_SOCKET_FLAG_CLOEXEC</primary></indexterm><programlisting>#define SOUP_SOCKET_FLAG_CLOEXEC "cloexec"
</programlisting>
<para>
An alias for the "cloexec" property.
</para></refsect2>
<refsect2>
<title><anchor id="SOUP-SOCKET-TIMEOUT:CAPS" role="macro"/>SOUP_SOCKET_TIMEOUT</title>
<indexterm><primary>SOUP_SOCKET_TIMEOUT</primary></indexterm><programlisting>#define SOUP_SOCKET_TIMEOUT "timeout"
</programlisting>
<para>
An alias for the "timeout" property.
</para></refsect2>
<refsect2>
<title><anchor id="SOUP-SOCKET-IS-SERVER:CAPS" role="macro"/>SOUP_SOCKET_IS_SERVER</title>
<indexterm><primary>SOUP_SOCKET_IS_SERVER</primary></indexterm><programlisting>#define SOUP_SOCKET_IS_SERVER "is-server"
</programlisting>
<para>
An alias for the "is-server" property.
</para></refsect2>
<refsect2>
<title><anchor id="SOUP-SOCKET-SSL-CREDENTIALS:CAPS" role="macro"/>SOUP_SOCKET_SSL_CREDENTIALS</title>
<indexterm><primary>SOUP_SOCKET_SSL_CREDENTIALS</primary></indexterm><programlisting>#define SOUP_SOCKET_SSL_CREDENTIALS "ssl-creds"
</programlisting>
<para>
An alias for the "ssl-creds" property.
</para></refsect2>
<refsect2>
<title><anchor id="SOUP-SOCKET-ASYNC-CONTEXT:CAPS" role="macro"/>SOUP_SOCKET_ASYNC_CONTEXT</title>
<indexterm><primary>SOUP_SOCKET_ASYNC_CONTEXT</primary></indexterm><programlisting>#define SOUP_SOCKET_ASYNC_CONTEXT "async-context"
</programlisting>
<para>
An alias for the "async-context" property.
</para></refsect2>
</refsect1>
<refsect1 role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2><title><anchor id="SoupSocket--async-context"/>The "<literal>async-context</literal>" property</title>
<indexterm><primary>SoupSocket:async-context</primary></indexterm><programlisting> "async-context" <link linkend="gpointer">gpointer</link> : Read / Write / Construct Only</programlisting>
<para>The GMainContext to dispatch this socket's async I/O in.</para></refsect2>
<refsect2><title><anchor id="SoupSocket--cloexec"/>The "<literal>cloexec</literal>" property</title>
<indexterm><primary>SoupSocket:cloexec</primary></indexterm><programlisting> "cloexec" <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
<para>Whether or not the socket will be closed automatically on exec().</para><para>Default value: FALSE</para>
</refsect2>
<refsect2><title><anchor id="SoupSocket--is-server"/>The "<literal>is-server</literal>" property</title>
<indexterm><primary>SoupSocket:is-server</primary></indexterm><programlisting> "is-server" <link linkend="gboolean">gboolean</link> : Read</programlisting>
<para>Whether or not the socket is a server socket.</para><para>Default value: FALSE</para>
</refsect2>
<refsect2><title><anchor id="SoupSocket--nodelay"/>The "<literal>nodelay</literal>" property</title>
<indexterm><primary>SoupSocket:nodelay</primary></indexterm><programlisting> "nodelay" <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
<para>Whether or not the socket uses TCP NODELAY.</para><para>Default value: TRUE</para>
</refsect2>
<refsect2><title><anchor id="SoupSocket--non-blocking"/>The "<literal>non-blocking</literal>" property</title>
<indexterm><primary>SoupSocket:non-blocking</primary></indexterm><programlisting> "non-blocking" <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
<para>Whether or not the socket uses non-blocking I/O.</para><para>Default value: TRUE</para>
</refsect2>
<refsect2><title><anchor id="SoupSocket--reuseaddr"/>The "<literal>reuseaddr</literal>" property</title>
<indexterm><primary>SoupSocket:reuseaddr</primary></indexterm><programlisting> "reuseaddr" <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
<para>Whether or not the socket uses the TCP REUSEADDR flag.</para><para>Default value: TRUE</para>
</refsect2>
<refsect2><title><anchor id="SoupSocket--ssl-creds"/>The "<literal>ssl-creds</literal>" property</title>
<indexterm><primary>SoupSocket:ssl-creds</primary></indexterm><programlisting> "ssl-creds" <link linkend="gpointer">gpointer</link> : Read / Write</programlisting>
<para>SSL credential information, passed from the session to the SSL implementation.</para></refsect2>
<refsect2><title><anchor id="SoupSocket--timeout"/>The "<literal>timeout</literal>" property</title>
<indexterm><primary>SoupSocket:timeout</primary></indexterm><programlisting> "timeout" <link linkend="guint">guint</link> : Read / Write</programlisting>
<para>Value in seconds to timeout a blocking I/O.</para><para>Default value: 0</para>
</refsect2>
</refsect1>
<refsect1 role="signals">
<title role="signals.title">Signal Details</title>
<refsect2><title><anchor id="SoupSocket-connect-result"/>The "connect-result" signal</title>
<indexterm><primary>SoupSocket::connect-result</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gint">gint</link> status,
<link linkend="gpointer">gpointer</link> user_data) : Run first</programlisting>
<para>
Emitted when a connection attempt succeeds or fails. This
is used internally by <link linkend="soup-socket-client-new-async"><function>soup_socket_client_new_async()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> the socket
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara> the status
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2><title><anchor id="SoupSocket-disconnected"/>The "disconnected" signal</title>
<indexterm><primary>SoupSocket::disconnected</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gpointer">gpointer</link> user_data) : Run last</programlisting>
<para>
Emitted when the socket is disconnected, for whatever
reason.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> the socket
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2><title><anchor id="SoupSocket-new-connection"/>The "new-connection" signal</title>
<indexterm><primary>SoupSocket::new-connection</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="SoupSocket">SoupSocket</link> *new,
<link linkend="gpointer">gpointer</link> user_data) : Run first</programlisting>
<para>
Emitted when a listening socket (set up with
<link linkend="soup-socket-listen"><function>soup_socket_listen()</function></link> or <link linkend="soup-socket-server-new"><function>soup_socket_server_new()</function></link>) receives a
new connection.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> the socket
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>new</parameter> :</term>
<listitem><simpara> the new socket
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2><title><anchor id="SoupSocket-readable"/>The "readable" signal</title>
<indexterm><primary>SoupSocket::readable</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gpointer">gpointer</link> user_data) : Run last</programlisting>
<para>
Emitted when an async socket is readable. See
<link linkend="soup-socket-read"><function>soup_socket_read()</function></link> and <link linkend="soup-socket-read-until"><function>soup_socket_read_until()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> the socket
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2><title><anchor id="SoupSocket-writable"/>The "writable" signal</title>
<indexterm><primary>SoupSocket::writable</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="SoupSocket">SoupSocket</link> *sock,
<link linkend="gpointer">gpointer</link> user_data) : Run last</programlisting>
<para>
Emitted when an async socket is writable. See
<link linkend="soup-socket-write"><function>soup_socket_write()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sock</parameter> :</term>
<listitem><simpara> the socket
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
</refentry>
|