WPILibC++ 2024.3.2
wpi::NetworkStream Class Referenceabstract

#include <wpinet/NetworkStream.h>

Inheritance diagram for wpi::NetworkStream:
wpi::TCPStream

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

Implemented in wpi::TCPStream.

◆ getNativeHandle()

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

Implemented in wpi::TCPStream.

◆ getPeerIP()

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

Implemented in wpi::TCPStream.

◆ getPeerPort()

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

Implemented in wpi::TCPStream.

◆ 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

Implemented in wpi::TCPStream.

◆ send()

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

Implemented in wpi::TCPStream.

◆ setBlocking()

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

Implemented in wpi::TCPStream.

◆ setNoDelay()

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

Implemented in wpi::TCPStream.


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