Description Usage Arguments Details Value Author(s)
When a socket is created it is attached to an address family, but it
doesn't have an address in this family. gSocketBind
assigns the
address (sometimes called name) of the socket.
1 | gSocketBind(object, address, allow.reuse, .errwarn = TRUE)
|
|
a |
|
a |
|
whether to allow reusing this address |
.errwarn |
Whether to issue a warning on error or fail silently |
It is generally required to bind to a local address before you can
receive connections. (See gSocketListen
and gSocketAccept
).
In certain situations, you may also want to bind a socket that will be
used to initiate connections, though this is not normally required.
allow.reuse
should be TRUE
for server sockets (sockets that you will
eventually call gSocketAccept
on), and FALSE
for client sockets.
(Specifically, if it is TRUE
, then gSocketBind
will set the
SO_REUSEADDR
flag on the socket, allowing it to bind address
even if
that address was previously used by another socket that has not yet been
fully cleaned-up by the kernel. Failing to set this flag on a server
socket may cause the bind call to return G_IO_ERROR_ADDRESS_IN_USE
if
the server program is stopped and then immediately restarted.)
Since 2.22
A list containing the following elements:
retval |
[logical] |
|
|
Derived by RGtkGen from GTK+ documentation
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.