WPILibC++ 2023.4.3
wpi::NetworkStream Class Referenceabstract

#include <wpinet/NetworkStream.h>

Public Types

enum  Error { kConnectionClosed = 0 , kConnectionReset = -1 , kConnectionTimedOut = -2 , kWouldBlock = -3 }
 

Public Member Functions

 NetworkStream ()=default
 
virtual ~NetworkStream ()=default
 
virtual size_t send (const char *buffer, size_t len, Error *err)=0
 
virtual size_t receive (char *buffer, size_t len, Error *err, int timeout=0)=0
 
virtual void close ()=0
 
virtual std::string_view getPeerIP () const =0
 
virtual int getPeerPort () const =0
 
virtual void setNoDelay ()=0
 
virtual bool setBlocking (bool enabled)=0
 
virtual int getNativeHandle () const =0
 
 NetworkStream (const NetworkStream &)=delete
 
NetworkStreamoperator= (const NetworkStream &)=delete
 

Member Enumeration Documentation

◆ Error

Enumerator
kConnectionClosed 
kConnectionReset 
kConnectionTimedOut 
kWouldBlock 

Constructor & Destructor Documentation

◆ NetworkStream() [1/2]

wpi::NetworkStream::NetworkStream ( )
default

◆ ~NetworkStream()

virtual wpi::NetworkStream::~NetworkStream ( )
virtualdefault

◆ NetworkStream() [2/2]

wpi::NetworkStream::NetworkStream ( const NetworkStream )
delete

Member Function Documentation

◆ close()

virtual void wpi::NetworkStream::close ( )
pure virtual

◆ getNativeHandle()

virtual int wpi::NetworkStream::getNativeHandle ( ) const
pure virtual

◆ getPeerIP()

virtual std::string_view wpi::NetworkStream::getPeerIP ( ) const
pure virtual

◆ getPeerPort()

virtual int wpi::NetworkStream::getPeerPort ( ) const
pure virtual

◆ operator=()

NetworkStream & wpi::NetworkStream::operator= ( const NetworkStream )
delete

◆ receive()

virtual size_t wpi::NetworkStream::receive ( char *  buffer,
size_t  len,
Error err,
int  timeout = 0 
)
pure virtual

◆ send()

virtual size_t wpi::NetworkStream::send ( const char *  buffer,
size_t  len,
Error err 
)
pure virtual

◆ setBlocking()

virtual bool wpi::NetworkStream::setBlocking ( bool  enabled)
pure virtual

◆ setNoDelay()

virtual void wpi::NetworkStream::setNoDelay ( )
pure virtual

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