poser
A C framework for POsix SERvices
Loading...
Searching...
No Matches
PSC_UnixServerOpts Class Reference

Options for creating a local UNIX server. More...

#include <poser/core/server.h>

Public Member Functions

PSC_UnixServerOptsPSC_UnixServerOpts_create (const char *name)
 PSC_UnixServerOpts constructor.
 
void PSC_UnixSeverOpts_readBufSize (PSC_UnixServerOpts *self, size_t sz)
 Set read buffer size.
 
void PSC_UnixServerOpts_owner (PSC_UnixServerOpts *self, int uid, int gid)
 Set ownership of the UNIX socket.
 
void PSC_UnixServerOpts_mode (PSC_UnixServerOpts *self, int mode)
 Set access mode for the UNIX socket.
 
void PSC_UnixServerOpts_destroy (PSC_UnixServerOpts *self)
 PSC_UnixServerOpts destructor.
 

Detailed Description

Options for creating a local UNIX server.

Member Function Documentation

◆ PSC_UnixServerOpts_create()

PSC_UnixServerOpts * PSC_UnixServerOpts_create ( const char *  name)

PSC_UnixServerOpts constructor.

Creates an options object initialized to default values.

Parameters
namethe file name (path) of the socket to listen on
Returns
a newly created options object

◆ PSC_UnixServerOpts_destroy()

void PSC_UnixServerOpts_destroy ( PSC_UnixServerOpts self)

PSC_UnixServerOpts destructor.

Parameters
selfthe PSC_UnixServerOpts

◆ PSC_UnixServerOpts_mode()

void PSC_UnixServerOpts_mode ( PSC_UnixServerOpts self,
int  mode 
)

Set access mode for the UNIX socket.

When not set, the default mode is 0600, so only the owner can interact with the socket.

Parameters
selfthe PSC_UnixServerOpts
modedesired access mode

◆ PSC_UnixServerOpts_owner()

void PSC_UnixServerOpts_owner ( PSC_UnixServerOpts self,
int  uid,
int  gid 
)

Set ownership of the UNIX socket.

When set, an attempt is made to change ownership of the socket.

Parameters
selfthe PSC_UnixServerOpts
uiddesired owner for the socket, -1 for no change
giddesired group for the socket, -1 for no change

◆ PSC_UnixSeverOpts_readBufSize()

void PSC_UnixSeverOpts_readBufSize ( PSC_UnixServerOpts self,
size_t  sz 
)

Set read buffer size.

Sets the size of the buffer used for connections accepted from this server, in bytes. The default value is 16 kiB.

Parameters
selfthe PSC_UnixServerOpts
szthe size of the read buffer, must be > 0

The documentation for this class was generated from the following file: