Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
FdUtils Struct Reference

Static Public Member Functions

static void repeated_read (int fd, void *buf, size_t size)
 Performs a reliable read from the given FD.
 
static void repeated_write (int fd, const void *buf, size_t size)
 Performs a reliable write to the given FD.
 
static void optimize_socket_fd (int fd)
 Optimizes the kernel settings like socket and TCP options for an fd that is an outgoing TCP socket.
 
static void optimize_tty_fd (int fd)
 Sets the kernel settings like queuing and terminal settings for an fd that is an outgoing tty.
 
static void optimize_fd (int fd)
 For an fd that is an outgoing link, detects what kind of file descriptor this is and calls the appropriate optimize call for it.
 

Detailed Description

Definition at line 43 of file FdUtils.hxx.

Member Function Documentation

◆ optimize_fd()

void FdUtils::optimize_fd ( int  fd)
static

For an fd that is an outgoing link, detects what kind of file descriptor this is and calls the appropriate optimize call for it.

Definition at line 119 of file FdUtils.cxx.

◆ optimize_socket_fd()

void FdUtils::optimize_socket_fd ( int  fd)
static

Optimizes the kernel settings like socket and TCP options for an fd that is an outgoing TCP socket.

Parameters
fdsocket file descriptor.

Definition at line 67 of file FdUtils.cxx.

◆ optimize_tty_fd()

void FdUtils::optimize_tty_fd ( int  fd)
static

Sets the kernel settings like queuing and terminal settings for an fd that is an outgoing tty.

Parameters
fdtty file descriptor.

Definition at line 102 of file FdUtils.cxx.

◆ repeated_read()

static void FdUtils::repeated_read ( int  fd,
void *  buf,
size_t  size 
)
inlinestatic

Performs a reliable read from the given FD.

Crashes if the read fails.

Parameters
fdthe file to read data from
bufthe location to write data to
sizehow many bytes to read

Definition at line 50 of file FdUtils.hxx.

◆ repeated_write()

static void FdUtils::repeated_write ( int  fd,
const void *  buf,
size_t  size 
)
inlinestatic

Performs a reliable write to the given FD.

Crashes if the write fails.

Parameters
fdthe file to write data to
bufthe location of the data to write
sizehow many bytes to write

Definition at line 71 of file FdUtils.hxx.


The documentation for this struct was generated from the following files: