Details
gnet_unix_socket_connect ()
GUnixSocket* gnet_unix_socket_connect (const gchar *path); |
A quick and easy GUnixSocket constructor. This connects to the
specified path. This function does block. Use this function when
you are a client connecting to a server and you don't mind
blocking.
gnet_unix_socket_new ()
GUnixSocket* gnet_unix_socket_new (const gchar *path); |
Connect to a specified address. Use this sort of socket when
you're a client connecting to a server. This function will block
to connect.
gnet_unix_socket_delete ()
void gnet_unix_socket_delete (GUnixSocket *s); |
Close and delete a GUnixSocket, regardless of reference count.
gnet_unix_socket_ref ()
void gnet_unix_socket_ref (GUnixSocket *s); |
Increment the reference counter of a GUnixSocket.
gnet_unix_socket_unref ()
void gnet_unix_socket_unref (GUnixSocket *s); |
Remove a reference from the GUnixSocket. When the reference count
reaches 0, the socket is deleted.
gnet_unix_socket_get_iochannel ()
GIOChannel* gnet_unix_socket_get_iochannel (GUnixSocket *socket); |
Get the GIOChannel for the GUnixSocket.
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 to be accepted.
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.
gnet_unix_socket_get_path ()
gchar* gnet_unix_socket_get_path (const GUnixSocket *socket); |
Get the path of the socket.
gnet_unix_socket_server_new ()
GUnixSocket* gnet_unix_socket_server_new (const gchar *path); |
Create and open a new GUnixSocket with the specified path. Use
this sort of socket when you are a server.
gnet_unix_socket_server_accept ()
GUnixSocket* gnet_unix_socket_server_accept (const GUnixSocket *socket); |
Accept connections from the socket. The socket must have been
created using gnet_unix_socket_server_new(). This function will
block (use gnet_unix_socket_server_accept_nonblock() if you don't
want to block). If the socket's GIOChannel is readable, it DOES
NOT mean that this function will block.
gnet_unix_socket_server_accept_nonblock ()
GUnixSocket* gnet_unix_socket_server_accept_nonblock
(const GUnixSocket *socket); |
Accept a connection from the socket without blocking. The socket
must have been created using gnet_unix_socket_server_new(). This
function is best used with the socket's 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.