1
0
mirror of https://gitlab.gnome.org/GNOME/glib.git synced 2025-08-19 23:28:54 +02:00
Files
.gitlab-ci
.reuse
LICENSES
docs
reference
gio
dbus-error.md
dbus-introspection.md
dbus-name-owning.md
dbus-name-watching.md
dbus-utils.md
error.md
file-attributes.md
gapplication.rst
gdbus-codegen.rst
gdbus.rst
gio-querymodules.rst
gio-unix.toml.in
gio-win32.toml.in
gio.rst
gio.toml.in
glib-compile-resources.rst
glib-compile-schemas.rst
gresource.rst
gsettings.rst
gvfs-overview.odg
gvfs-overview.png
io-scheduler.md
menu-example.png
menu-exporter.md
menu-model-dark.svg
menu-model-light.svg
meson.build
migrating-gconf.md
migrating-gdbus.md
migrating-gnome-vfs.md
migrating-posix.md
networking.md
overview.md
pollable-utils.md
tls-overview.md
unix-mounts.md
girepository
glib
gmodule
gobject
AUTHORS
COPYING
NEWS
meson.build
urlmap.js
CODEOWNERS
backports.md
issue-and-merge-request-management.md
macros.md
meson-version.md
rationales.md
releasing.md
roadmap.md
supported-platforms.md
testing.md
toolchain-requirements.md
win32-build.md
fuzzing
gio
girepository
glib
gmodule
gobject
gthread
m4macros
po
subprojects
tests
tools
.clang-format
.dir-locals.el
.editorconfig
.gitignore
.gitlab-ci.yml
.gitmodules
.lcovrc
CODE_OF_CONDUCT.md
CONTRIBUTING.md
INSTALL.md
NEWS
README.md
SECURITY.md
glib.doap
meson.build
meson.options
glib/docs/reference/gio/networking.md
Philip Withnall 708de2fc12 docs: Move the gnetworking SECTION
Move it to a separate page.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: 
2023-11-15 11:48:23 +00:00

1.1 KiB

Title: gnetworking.h SPDX-License-Identifier: LGPL-2.1-or-later SPDX-FileCopyrightText: 2010 Dan Winship

gnetworking.h

The <gio/gnetworking.h> header can be included to get various low-level networking-related system headers, automatically taking care of certain portability issues for you.

This can be used, for example, if you want to call setsockopt() on a [class@Gio.Socket].

Note that while WinSock has many of the same APIs as the traditional UNIX socket API, most of them behave at least slightly differently (particularly with respect to error handling). If you want your code to work under both UNIX and Windows, you will need to take these differences into account.

Also, under GNU libc, certain non-portable functions are only visible in the headers if you define _GNU_SOURCE before including them. Note that this symbol must be defined before including any headers, or it may not take effect.

There is one function provided specifically for initialising the networking APIs, which needs to be called only if they are being used before GLib initialises itself:

  • [func@Gio.networking_init]