GSocket* g_socket_new ( GSocketFamily family, GSocketType type, GSocketProtocol protocol, GError** error )
Creates a new
GSocket with the defined family, type and protocol.
protocol is 0 (
G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
for the family and type is used.
protocol is a family and type specific int that specifies what
kind of protocol to use.
GSocketProtocol lists several common ones.
Many families only support one protocol, and use 0 for this, others
support several and using 0 means to use the default protocol for
the family and type.
The protocol id is passed directly to the operating
system, so you can use protocols not listed in
GSocketProtocol if you
know the protocol number used for it.
Available since: 2.22
The socket family to use, e.g.
The socket type to use.
The id of the protocol to use, or 0 for default.
The return location for a recoverable error.
The argument can be
If the return location is not
NULL, then you must initialize it to a
The argument will be left initialized to
NULLby the constructor if there are no errors.
In case of error, the argument will be set to a newly allocated
GError; the caller will take ownership of the data, and be responsible for freeing it.
NULL on error.
Free the returned object with g_object_unref().
|The caller of the function takes ownership of the data, and is responsible for freeing it.|