reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Socket.cxx File Reference
#include "rutil/ResipAssert.h"
#include <fcntl.h>
#include <errno.h>
#include "rutil/compat.hxx"
#include "rutil/Socket.hxx"
#include "rutil/Logger.hxx"
#include <unistd.h>
#include <sys/resource.h>

Go to the source code of this file.

Macros

#define RESIPROCATE_SUBSYSTEM   Subsystem::TRANSPORT
 

Functions

static int trySetRcvBuf (Socket fd, int buflen)
 Some OSs (Linux in particular) silently ignore requests to set too big and do not return an error code.
 

Macro Definition Documentation

◆ RESIPROCATE_SUBSYSTEM

#define RESIPROCATE_SUBSYSTEM   Subsystem::TRANSPORT

Definition at line 18 of file Socket.cxx.

Function Documentation

◆ trySetRcvBuf()

static int trySetRcvBuf ( Socket  fd,
int  buflen 
)
static

Some OSs (Linux in particular) silently ignore requests to set too big and do not return an error code.

Thus we always check. Also, the returned value (getsockopt) can be larger than the requested value (kernel internally doubles). manpage says sockopt uses integer as data-type If {buflen} is negative, we skip the set and just read Return the get size or -1 if the set didn't work

Definition at line 214 of file Socket.cxx.