gem5  v22.0.0.2
Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
gem5::ListenSocket Class Reference

#include <socket.hh>

Inheritance diagram for gem5::ListenSocket:
MockListenSocket

Static Public Member Functions

static void disableAll ()
 
static bool allDisabled ()
 
static void loopbackOnly ()
 

Static Protected Member Functions

static void cleanup ()
 

Protected Attributes

bool listening
 
int fd
 

Static Protected Attributes

static bool listeningDisabled = false
 The following variables are only used by socket unit tests: listeningDisabled, anyListening, bindToLoopback. More...
 
static bool anyListening = false
 
static bool bindToLoopback = false
 
static int socketCloexec (int domain, int type, int protocol)
 
static int acceptCloexec (int sockfd, struct sockaddr *addr, socklen_t *addrlen)
 
 ListenSocket ()
 
virtual ~ListenSocket ()
 
virtual int accept (bool nodelay=false)
 
virtual bool listen (int port, bool reuse=true)
 
int getfd () const
 
bool islistening () const
 

Detailed Description

Definition at line 38 of file socket.hh.

Constructor & Destructor Documentation

◆ ~ListenSocket()

gem5::ListenSocket::~ListenSocket ( )
virtual

Definition at line 114 of file socket.cc.

References fd.

Member Function Documentation

◆ accept()

int gem5::ListenSocket::accept ( bool  nodelay = false)
virtual

◆ acceptCloexec()

int gem5::ListenSocket::acceptCloexec ( int  sockfd,
struct sockaddr *  addr,
socklen_t *  addrlen 
)
static

Definition at line 96 of file socket.cc.

References gem5::X86ISA::addr.

Referenced by accept(), and gem5::memory::SharedMemoryServer::ListenSocketEvent::process().

◆ allDisabled()

bool gem5::ListenSocket::allDisabled ( )
static

◆ cleanup()

void gem5::ListenSocket::cleanup ( )
staticprotected

Definition at line 55 of file socket.cc.

References anyListening, bindToLoopback, and listeningDisabled.

◆ disableAll()

void gem5::ListenSocket::disableAll ( )
static

Definition at line 63 of file socket.cc.

References anyListening, listeningDisabled, and panic.

Referenced by gem5::pybind_init_core(), and TEST().

◆ getfd()

int gem5::ListenSocket::getfd ( ) const
inline

◆ islistening()

bool gem5::ListenSocket::islistening ( ) const
inline

◆ listen()

bool gem5::ListenSocket::listen ( int  port,
bool  reuse = true 
)
virtual

◆ loopbackOnly()

void gem5::ListenSocket::loopbackOnly ( )
static

Definition at line 77 of file socket.cc.

References anyListening, bindToLoopback, and panic.

Referenced by gem5::pybind_init_core().

◆ socketCloexec()

int gem5::ListenSocket::socketCloexec ( int  domain,
int  type,
int  protocol 
)
static

Member Data Documentation

◆ anyListening

bool gem5::ListenSocket::anyListening = false
staticprotected

Definition at line 46 of file socket.hh.

Referenced by cleanup(), disableAll(), listen(), and loopbackOnly().

◆ bindToLoopback

bool gem5::ListenSocket::bindToLoopback = false
staticprotected

Definition at line 48 of file socket.hh.

Referenced by cleanup(), listen(), and loopbackOnly().

◆ fd

int gem5::ListenSocket::fd
protected

Definition at line 58 of file socket.hh.

Referenced by accept(), getfd(), listen(), and ~ListenSocket().

◆ listening

bool gem5::ListenSocket::listening
protected

Definition at line 57 of file socket.hh.

Referenced by islistening(), and listen().

◆ listeningDisabled

bool gem5::ListenSocket::listeningDisabled = false
staticprotected

The following variables are only used by socket unit tests: listeningDisabled, anyListening, bindToLoopback.

Definition at line 45 of file socket.hh.

Referenced by allDisabled(), cleanup(), and disableAll().


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

Generated on Thu Jul 28 2022 13:33:06 for gem5 by doxygen 1.8.17