Server Wait On Clients System - API Documentation  v1.6.4
Server Wait On Clients System.
comms.c File Reference

Comms functions associated with the swocserverd daemon. More...

#include <netdb.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/epoll.h>
#include <sys/socket.h>
#include <syslog.h>
#include <unistd.h>
#include "internal.h"
#include <libmgec/libmgec.h>
#include <libmgec/mge-bstree.h>
#include <libmgec/mge-buffer.h>
#include <libmgec/mge-errno.h>
#include <libmgec/mge-message.h>
#include <swoc/libswoccommon.h>
Include dependency graph for comms.c:

Macros

#define _Bool   signed char
 
#define bool   _Bool
 
#define false   0
 
#define true   1
 
#define __bool_true_false_are_defined   1
 

Functions

static int bind_ports (int *sfd, int *portno, struct addrinfo *hints)
 
static int init_epoll (int *pepfd, struct epoll_event *pevent, struct comm_spec *pt_ps)
 
static int proc_events (int n_events, struct epoll_event *pevents)
 
static int proc_msg (struct mgemessage *message)
 
int prepare_sockets (void)
 Prepare all sockets. More...
 
int process_comms (void)
 Wait and then process communications. More...
 

Detailed Description

Comms functions associated with the swocserverd daemon.

Author
Copyright (C) 2017-2022 Mark Grant

Released under the GPLv3 only.
SPDX-License-Identifier: GPL-3.0-only

Version
v1.0.23 ==== 17/09/2022

Macro Definition Documentation

◆ __bool_true_false_are_defined

#define __bool_true_false_are_defined   1

◆ _Bool

#define _Bool   signed char

◆ bool

#define bool   _Bool

◆ false

#define false   0

◆ true

#define true   1

Function Documentation

◆ bind_ports()

static int bind_ports ( int *  sfd,
int *  portno,
struct addrinfo *  hints 
)
static

◆ init_epoll()

static int init_epoll ( int *  pepfd,
struct epoll_event *  pevent,
struct comm_spec *  pt_ps 
)
static

◆ prepare_sockets()

int prepare_sockets ( void  )

Prepare all sockets.

On error mge_errno will be set.

Returns
0 on success, < zero on failure.

◆ proc_events()

static int proc_events ( int  n_events,
struct epoll_event *  pevents 
)
static

◆ proc_msg()

static int proc_msg ( struct mgemessage *  message)
static

◆ process_comms()

int process_comms ( void  )

Wait and then process communications.

On error mge_errno will be set.

Returns
0 on success, < zero on failure.