Sponge
CS144's user-space TCP library
Functions | Variables
tcp_sponge_socket.cc File Reference
#include "tcp_sponge_socket.hh"
#include "parser.hh"
#include "tun.hh"
#include "util.hh"
#include <cstddef>
#include <exception>
#include <iostream>
#include <stdexcept>
#include <string>
#include <sys/socket.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
#include <utility>
Include dependency graph for tcp_sponge_socket.cc:

Go to the source code of this file.

Functions

static pair< FileDescriptor, FileDescriptorsocket_pair_helper (const int type)
 Call socketpair and return connected Unix-domain sockets of specified type. More...
 

Variables

static constexpr size_t TCP_TICK_MS = 10
 

Function Documentation

◆ socket_pair_helper()

static pair<FileDescriptor, FileDescriptor> socket_pair_helper ( const int  type)
inlinestatic

Call socketpair and return connected Unix-domain sockets of specified type.

Parameters
[in]typeis the type of AF_UNIX sockets to create (e.g., SOCK_SEQPACKET)
Returns
a std::pair of connected sockets

Definition at line 167 of file tcp_sponge_socket.cc.

Variable Documentation

◆ TCP_TICK_MS

constexpr size_t TCP_TICK_MS = 10
staticconstexpr

Definition at line 20 of file tcp_sponge_socket.cc.