YARP
Yet Another Robot Platform
yarp::os::impl::TcpFace Class Reference

Communicating with a port via TCP. More...

#include <yarp/os/impl/TcpFace.h>

+ Inheritance diagram for yarp::os::impl::TcpFace:

Public Member Functions

 TcpFace ()
 
 ~TcpFace () override
 
bool open (const Contact &address) override
 Start listening to the given address. More...
 
void close () override
 Stop listening. More...
 
InputProtocolread () override
 return nullptr on failure. More...
 
OutputProtocolwrite (const Contact &address) override
 Try to reach out and talk to someone. More...
 
Contact getLocalAddress () const override
 Get address after open(), if more specific that the address provided to open() - otherwise an invalid address is returned. More...
 
- Public Member Functions inherited from yarp::os::Face
 Face ()=default
 Constructor. More...
 
virtual ~Face ()=default
 Destructor. More...
 
virtual bool open (const Contact &address)=0
 Start listening to the given address. More...
 
virtual void close ()=0
 Stop listening. More...
 
virtual InputProtocolread ()=0
 Block and wait for someone to talk to us. More...
 
virtual OutputProtocolwrite (const Contact &address)=0
 Try to reach out and talk to someone. More...
 
virtual Contact getLocalAddress () const
 Get address after open(), if more specific that the address provided to open() - otherwise an invalid address is returned. More...
 

Protected Attributes

yarp::os::impl::AuthHMAC auth
 

Detailed Description

Communicating with a port via TCP.

Definition at line 21 of file TcpFace.h.

Constructor & Destructor Documentation

◆ TcpFace()

TcpFace::TcpFace ( )
default

◆ ~TcpFace()

TcpFace::~TcpFace ( )
override

Definition at line 27 of file TcpFace.cpp.

Member Function Documentation

◆ close()

void TcpFace::close ( )
overridevirtual

Stop listening.

Implements yarp::os::Face.

Definition at line 63 of file TcpFace.cpp.

◆ getLocalAddress()

Contact TcpFace::getLocalAddress ( ) const
overridevirtual

Get address after open(), if more specific that the address provided to open() - otherwise an invalid address is returned.

Returns
an address

Reimplemented from yarp::os::Face.

Definition at line 148 of file TcpFace.cpp.

◆ open()

bool TcpFace::open ( const Contact address)
overridevirtual

Start listening to the given address.

Parameters
addressthe parameters needed for listening. E.g. for TCP, this would contain a socket number.
Returns
true on success.

Implements yarp::os::Face.

Definition at line 33 of file TcpFace.cpp.

◆ read()

InputProtocol * TcpFace::read ( )
overridevirtual

return nullptr on failure.

No exceptions thrown.

Implements yarp::os::Face.

Definition at line 90 of file TcpFace.cpp.

◆ write()

OutputProtocol * TcpFace::write ( const Contact address)
overridevirtual

Try to reach out and talk to someone.

Parameters
addressparameters describing destination. For example, for TCP this would contain a machine name/IP address, and a socket number.
Returns
a protocol object to talk with, or nullptr on failure.

Implements yarp::os::Face.

Definition at line 120 of file TcpFace.cpp.

Member Data Documentation

◆ auth

yarp::os::impl::AuthHMAC yarp::os::impl::TcpFace::auth
protected

Definition at line 41 of file TcpFace.h.


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