Connection concept

PreviousNext

Overview

This page discusses the concept of connections and how to handle them.

Introduction

Even though UDP is connectionless, the framework builds the illusion of a connection. EM_NET_CONNECTION encapsulates everything that's needed to manage network connections. An important mechanism is that connections can join several groups if needed. This is explained later.

Usage

There are two different ways to create and add a connection manually to a group:

The last recently created connection can be accessed through last_created_connection.

If you want to delete a connection you simply use the feature delete_connection providing a reference to an existing connection.

Hint:

Each connection has its "personal group" (see: personal_group), which does not imply that it is the only member of this group: If you want to implement a logger, which logs all events which are directly sent to a certain peer, you can simply add the logger to its personal group.