Details
SOUP_SERVER_ANY_PORT
#define SOUP_SERVER_ANY_PORT 0 |
SoupAddressNewId
typedef gpointer SoupAddressNewId; |
enum SoupAddressStatus
typedef enum {
SOUP_ADDRESS_STATUS_OK,
SOUP_ADDRESS_STATUS_ERROR
} SoupAddressStatus; |
soup_address_new ()
Create a SoupAddress from a name and port asynchronously. Once the
structure is created, it will call the callback. It may call the
callback before the function returns. It will call the callback
if there is a failure.
The Unix version forks and does the lookup, which can cause some
problems. In general, this will work ok for most programs most of
the time. It will be slow or even fail when using operating
systems that copy the entire process when forking.
If you need to lookup a lot of addresses, we recommend calling
g_main_iteration(FALSE) between calls. This will help prevent an
explosion of processes.
If you need a more robust library for Unix, look at <ulink
url="http://www.gnu.org/software/adns/adns.html">GNU ADNS</ulink>.
GNU ADNS is under the GNU GPL.
The Windows version should work fine. Windows has an asynchronous
DNS lookup function.
soup_address_new_cancel ()
Cancel an asynchronous SoupAddress creation that was started with
soup_address_new().
soup_address_ref ()
Increment the reference counter of the SoupAddress.
soup_address_unref ()
Remove a reference from the SoupAddress. When reference count
reaches 0, the address is deleted.
SoupAddressGetNameId
typedef gpointer SoupAddressGetNameId; |
soup_address_get_name ()
Get the nice name of the address (eg, "mofo.eecs.umich.edu").
This function will use the callback once it knows the nice name.
It may even call the callback before it returns. The callback
will be called if there is an error.
The Unix version forks and does the reverse lookup. This has
problems. See the notes for soup_address_new(). The
Windows version should work fine.
soup_address_get_name_cancel ()
Cancel an asynchronous nice name lookup that was started with
soup_address_get_name().
soup_address_get_canonical_name ()
Get the "canonical" name of an address (eg, for IP4 the dotted
decimal name 141.213.8.59).
soup_address_get_port ()
Get the port number.
soup_address_hash ()
Hash the address. This is useful for glib containers.
soup_address_noport_equal ()
Compare two SoupAddress's, but does not compare the port numbers.
soup_address_gethostname ()
gchar* soup_address_gethostname (void); |
Get the primary host's name.
soup_address_gethostaddr ()
Get the primary host's SoupAddress.
SoupSocketConnectId
typedef gpointer SoupSocketConnectId; |
enum SoupSocketConnectStatus
typedef enum {
SOUP_SOCKET_CONNECT_ERROR_NONE,
SOUP_SOCKET_CONNECT_ERROR_ADDR_RESOLVE,
SOUP_SOCKET_CONNECT_ERROR_NETWORK
} SoupSocketConnectStatus; |
soup_socket_connect ()
A quick and easy non-blocking SoupSocket constructor. This
connects to the specified address and port and then calls the
callback with the data. Use this function when you're a client
connecting to a server and you don't want to block or mess with
SoupAddress's. It may call the callback before the function
returns. It will call the callback if there is a failure.
soup_socket_connect_cancel ()
Cancel an asynchronous connection that was started with
soup_socket_connect().
soup_socket_connect_sync ()
SoupSocketNewId
typedef gpointer SoupSocketNewId; |
enum SoupSocketNewStatus
typedef enum {
SOUP_SOCKET_NEW_STATUS_OK,
SOUP_SOCKET_NEW_STATUS_ERROR
} SoupSocketNewStatus; |
soup_socket_new ()
Connect to a specifed address asynchronously. When the connection
is complete or there is an error, it will call the callback. It
may call the callback before the function returns. It will call
the callback if there is a failure.
soup_socket_new_cancel ()
Cancel an asynchronous connection that was started with
soup_socket_new().
soup_socket_ref ()
Increment the reference counter of the SoupSocket.
soup_socket_unref ()
Remove a reference from the SoupSocket. When reference count
reaches 0, the socket is deleted.
soup_socket_get_iochannel ()
Get the GIOChannel for the SoupSocket.
For a client socket, the GIOChannel represents the data stream.
Use it like you would any other GIOChannel.
For a server socket however, the GIOChannel represents incoming
connections. If you can read from it, there's a connection
waiting.
There is one channel for every socket. This function refs the
channel before returning it. You should unref the channel when
you are done with it. However, you should not close the channel -
this is done when you delete the socket.
soup_socket_get_address ()
Get the address of the socket. If the socket is client socket,
the address is the address of the remote host it is connected to.
If the socket is a server socket, the address is the address of
the local host. (Though you should use
soup_address_gethostaddr() to get the SoupAddress of the local
host.)
soup_socket_get_port ()
Get the port number the socket is bound to.
soup_socket_server_new ()
Create and open a new SoupSocket with the specified port number.
Use this sort of socket when your are a server and you know what
the port number should be (or pass 0 if you don't care what the
port is).
soup_socket_server_accept ()
Accept a connection from the socket. The socket must have been
created using soup_socket_server_new(). This function will
block (use soup_socket_server_try_accept() if you don't
want to block). If the socket's GIOChannel is readable, it DOES
NOT mean that this function will not block.
soup_socket_server_try_accept ()
Accept a connection from the socket without blocking. The socket
must have been created using soup_socket_server_new(). This
function is best used with the sockets GIOChannel. If the
channel is readable, then you PROBABLY have a connection. It is
possible for the connection to close by the time you call this, so
it may return NULL even if the channel was readable.