Generic addressing type independent INet protocol facet. More...

#include <senf/Socket/Protocols/INet/INetSocketProtocol.hh>

Inheritance diagram for senf::INetSocketProtocol:

Public Member Functions

void bindInterface (std::string const &iface) const
 Bind socket to specific interface. More...
 
std::string bindInterface ()
 Get bound interface. More...
 
- Public Member Functions inherited from senf::SocketProtocol
virtual SocketPolicyBase const & policy () const =0
 Access the policy instance. More...
 
virtual unsigned available () const =0
 Return (maximum) number of bytes available for reading without < blocking. More...
 
virtual bool eof () const =0
 Check for end-of-file condition. More...
 
virtual void close ()
 Close socket. More...
 
virtual void terminate () const
 Forcibly close socket. More...
 
virtual void state (SocketStateMap &map, unsigned lod) const
 Return socket state information. More...
 
int fd () const
 Get file descriptor. More...
 
 SocketProtocol ()
 
virtual ~SocketProtocol ()=0
 

Additional Inherited Members

- Protected Member Functions inherited from senf::SocketProtocol
FileHandle fh () const
 Get a FileHandle for this instance. More...
 
void fd (int) const
 Initialize file descriptor. More...
 

Detailed Description

Generic addressing type independent INet protocol facet.

Definition at line 40 of file INetSocketProtocol.hh.

Member Function Documentation

◆ bindInterface() [1/2]

void senf::INetSocketProtocol::bindInterface ( std::string const &  iface) const

Bind socket to specific interface.

When a socket is bound to an interface, it will only receive data received on that interface. If the interface name is empty, the binding is removed.

Parameters
[in]ifacename of interface to bind to or empty to remove binding
Implementation note:
Sets the SO_BINDTODEVICE socket option

Definition at line 33 of file INetSocketProtocol.cc.

◆ bindInterface() [2/2]

std::string senf::INetSocketProtocol::bindInterface ( )

Get bound interface.

Returns the interface, the socket is currently bound to. Returns the empty string, if not bound to any interface.

Returns
Bound interface name

Definition at line 40 of file INetSocketProtocol.cc.


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