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...
 

Protected Attributes

yarp::os::impl::AuthHMAC auth
 

Detailed Description

Communicating with a port via TCP.

Definition at line 26 of file TcpFace.h.

Constructor & Destructor Documentation

◆ TcpFace()

TcpFace::TcpFace ( )
default

◆ ~TcpFace()

TcpFace::~TcpFace ( )
override

Definition at line 30 of file TcpFace.cpp.

Member Function Documentation

◆ close()

void TcpFace::close ( )
overridevirtual

Stop listening.

Implements yarp::os::Face.

Definition at line 66 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 151 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 36 of file TcpFace.cpp.

◆ read()

InputProtocol * TcpFace::read ( )
overridevirtual

return nullptr on failure.

No exceptions thrown.

Implements yarp::os::Face.

Definition at line 93 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 123 of file TcpFace.cpp.

Member Data Documentation

◆ auth

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

Definition at line 46 of file TcpFace.h.


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