nl::Inet::SocketEvents

#include <src/inet/InetLayerBasis.h>

Represent a set of I/O events requested/pending on a socket.

Summary

Constructors and Destructors

SocketEvents()
Constructor for the SocketEvents class.
SocketEvents(const SocketEvents & other)
Copy constructor for the SocketEvents class.

Public types

@4{
  kRead = 0x01,
  kWrite = 0x02,
  kError = 0x04
}
enum

Public attributes

Value
int
Contains the bit flags for the socket event.

Public functions

Clear()
void
Clear the bit flags for the socket.
ClearError()
void
Clear the error bit flag for the socket.
ClearRead()
void
Clear the read bit flag for the socket.
ClearWrite()
void
Clear the write bit flag for the socket.
IsError() const
bool
Check if the bit flags indicate that the socket has an error.
IsReadable() const
bool
Check if the bit flags indicate that the socket is readable.
IsSet() const
bool
Check if any of the bit flags for the socket events are set.
IsWriteable() const
bool
Check if the bit flags indicate that the socket is writable.
SetError()
void
Set the error bit flag for the socket.
SetFDs(int socket, int & nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds)
void
Sets the bit for the specified file descriptor in the given sets of file descriptors.
SetRead()
void
Set the read bit flag for the socket.
SetWrite()
void
Set the write bit flag for the socket.

Public static functions

FromFDs(int socket, fd_set *readfds, fd_set *writefds, fd_set *exceptfds)
Set the read, write or exception bit flags for the specified socket based on its status in the corresponding file descriptor sets.

Public types

@4

 @4
Properties
kError

Bit flag indicating if there is an error event on a socket.

kRead

Bit flag indicating if there is a read event on a socket.

kWrite

Bit flag indicating if there is a write event on a socket.

Public attributes

Value

int Value

Contains the bit flags for the socket event.

Public functions

Clear

void Clear()

Clear the bit flags for the socket.

ClearError

void ClearError()

Clear the error bit flag for the socket.

ClearRead

void ClearRead()

Clear the read bit flag for the socket.

ClearWrite

void ClearWrite()

Clear the write bit flag for the socket.

IsError

bool IsError() const 

Check if the bit flags indicate that the socket has an error.

Details
Returns
true if socket has an error, otherwise false.

IsReadable

bool IsReadable() const 

Check if the bit flags indicate that the socket is readable.

Details
Returns
true if socket is readable, otherwise false.

IsSet

bool IsSet() const 

Check if any of the bit flags for the socket events are set.

Details
Returns
true if set, otherwise false.

IsWriteable

bool IsWriteable() const 

Check if the bit flags indicate that the socket is writable.

Details
Returns
true if socket is writable, otherwise false.

SetError

void SetError()

Set the error bit flag for the socket.

SetFDs

void SetFDs(
  int socket,
  int & nfds,
  fd_set *readfds,
  fd_set *writefds,
  fd_set *exceptfds
)

Sets the bit for the specified file descriptor in the given sets of file descriptors.

Details
Parameters
[in] socket
The file descriptor for which the bit is being set.
[out] nfds
A reference to the range of file descriptors in the set.
[in] readfds
A pointer to the set of readable file descriptors.
[in] writefds
A pointer to the set of writable file descriptors.
[in] exceptfds
A pointer to the set of file descriptors with errors.

SetRead

void SetRead()

Set the read bit flag for the socket.

SetWrite

void SetWrite()

Set the write bit flag for the socket.

SocketEvents

 SocketEvents()

Constructor for the SocketEvents class.

SocketEvents

 SocketEvents(
  const SocketEvents & other
)

Copy constructor for the SocketEvents class.

Public static functions

FromFDs

SocketEvents FromFDs(
  int socket,
  fd_set *readfds,
  fd_set *writefds,
  fd_set *exceptfds
)

Set the read, write or exception bit flags for the specified socket based on its status in the corresponding file descriptor sets.

Details
Parameters
[in] socket
The file descriptor for which the bit flags are being set.
[in] readfds
A pointer to the set of readable file descriptors.
[in] writefds
A pointer to the set of writable file descriptors.
[in] exceptfds
A pointer to the set of file descriptors with errors.