<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/glib-now-has-a-datagram-interface-qchl2rnua" -->

---
title: GLib now has a datagram interface | daily.dev
description: GLib has introduced a new GDatagramBased interface, providing a GLib-native abstraction for datagram (packet-based) I/O. Modeled after the Linux...
canonical: https://daily.dev/posts/glib-now-has-a-datagram-interface-qchl2rnua
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: GLib now has a datagram interface | daily.dev
og:description: GLib has introduced a new GDatagramBased interface, providing a GLib-native abstraction for datagram (packet-based) I/O. Modeled after the Linux...
og:url: https://daily.dev/posts/glib-now-has-a-datagram-interface-qchl2rnua
og:image: https://api.daily.dev/og/posts/QCHl2rNUa.png
og:image:alt: GLib now has a datagram interface
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GLib now has a datagram interface

**[Collabora Blog](https://daily.dev/sources/collabora)** · 2 min read · 0 upvotes · 0 comments

## Summary

GLib has introduced a new GDatagramBased interface, providing a GLib-native abstraction for datagram (packet-based) I/O. Modeled after the Linux recvmmsg()/sendmmsg() system calls, it uses GInputMessage and GOutputMessage structures. The interface supports polling and potentially-blocking I/O via a timeout parameter: zero for non-blocking, negative for blocking. Key functions include g_datagram_based_receive_messages, g_datagram_based_send_messages, and condition-checking utilities. The API currently lacks introspection support but this can be added via convenience API for boxed types. The planned use case is exposing ICE connections in libnice as GDatagramBased instances.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.collabora.com/about-us/blog/2015/10/13/glib-now-has-a-datagram-interface>

## Questions this post answers

### What is the GDatagramBased interface in GLib and how does the timeout parameter work?

GDatagramBased is a GLib interface for datagram (packet-based) I/O, analogous to GIOStream but for datagrams. Its receive and send functions accept a timeout parameter: set to zero for non-blocking behavior (returns G_IO_ERROR_WOULD_BLOCK if it would block), or negative for blocking behavior that waits until at least some I/O can be performed. The API mirrors Linux's recvmmsg()/sendmmsg() system calls.

_Developers building GLib network code can track GIO API changes like this on daily.dev._

### Does GDatagramBased in GLib support GObject introspection?

GDatagramBased does not currently support GObject introspection. The limitation stems from how GInputMessage and GOutputMessage are used as in-out parameters. Introspection support can be added in the future by creating convenience API to allocate and free the message structures as boxed types, as noted in the GNOME bugzilla discussion.

_Keeping up with GLib API limitations and workarounds is easier when the relevant discussions surface on daily.dev._

## Similar posts on daily.dev

- [Erlang socket layer throughput improvements](https://daily.dev/posts/erlang-socket-layer-throughput-improvements-k54xnpxbv) · Erlang Forums · 0 upvotes · 0 comments
- [\[RFC idea\] DTLS support in ext/openssl \(Openssl\\Dtls\)](https://daily.dev/posts/rfc-idea-dtls-support-in-ext-openssl-openssl-dtls--v6boekfqy) · externals.io · 0 upvotes · 0 comments
- [nanomsg-NG](https://daily.dev/posts/nanomsg-ng-2hdxgfzyz) · Ruby Flow · 0 upvotes · 0 comments
- [GNUnet 0.27 Released For Those With "Some Reasonable Pain Tolerance"](https://daily.dev/posts/gnunet-0-27-released-for-those-with-some-reasonable-pain-tolerance--jevdqxowl) · Phoronix · 0 upvotes · 0 comments
- [A Deep Dive into Gabeldorsche: The Bluetooth Stack Android Rebuilt on Purpose](https://daily.dev/posts/a-deep-dive-into-gabeldorsche-the-bluetooth-stack-android-rebuilt-on-purpose-yev4lddv2) · freeCodeCamp · 0 upvotes · 0 comments

---

Tags: [#linux](https://daily.dev/tags/linux)

[View this post on daily.dev](https://daily.dev/posts/glib-now-has-a-datagram-interface-qchl2rnua)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"GLib now has a datagram interface","url":"https://daily.dev/posts/glib-now-has-a-datagram-interface-qchl2rnua","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/glib-now-has-a-datagram-interface-qchl2rnua"},"datePublished":"2026-08-11T08:56:58.345Z","dateModified":"2026-08-11T09:43:32.517Z","description":"GLib has introduced a new GDatagramBased interface, providing a GLib-native abstraction for datagram (packet-based) I/O. Modeled after the Linux...","image":"https://media.daily.dev/image/upload/s--2-1xRawN--/f_auto/v1722860399/public/Placeholder%2011","thumbnailUrl":"https://media.daily.dev/image/upload/s--2-1xRawN--/f_auto/v1722860399/public/Placeholder%2011","isAccessibleForFree":true,"articleSection":"Collabora Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Collabora Blog","logo":"https://media.daily.dev/image/upload/s--ZGZ0FjqS--/f_auto,q_auto/v1786438306/logos/collabora?_a=BAMAMicg0","url":"https://daily.dev/sources/collabora"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/glib-now-has-a-datagram-interface-qchl2rnua","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"linux","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Collabora Blog","item":"https://daily.dev/sources/collabora"},{"@type":"ListItem","position":3,"name":"GLib now has a datagram interface"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/glib-now-has-a-datagram-interface-qchl2rnua#faq","mainEntity":[{"@type":"Question","name":"What is the GDatagramBased interface in GLib and how does the timeout parameter work?","acceptedAnswer":{"@type":"Answer","text":"GDatagramBased is a GLib interface for datagram (packet-based) I/O, analogous to GIOStream but for datagrams. Its receive and send functions accept a timeout parameter: set to zero for non-blocking behavior (returns G_IO_ERROR_WOULD_BLOCK if it would block), or negative for blocking behavior that waits until at least some I/O can be performed. The API mirrors Linux's recvmmsg()/sendmmsg() system calls. Developers building GLib network code can track GIO API changes like this on daily.dev."}},{"@type":"Question","name":"Does GDatagramBased in GLib support GObject introspection?","acceptedAnswer":{"@type":"Answer","text":"GDatagramBased does not currently support GObject introspection. The limitation stems from how GInputMessage and GOutputMessage are used as in-out parameters. Introspection support can be added in the future by creating convenience API to allocate and free the message structures as boxed types, as noted in the GNOME bugzilla discussion. Keeping up with GLib API limitations and workarounds is easier when the relevant discussions surface on daily.dev."}}]}
```

