TinyPPP
PPP networking over any Arduino Stream
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PPPServer Class Reference

TCP server over PPP: used like WiFiServer or EthernetServer. More...

#include <PPPSockets.h>

Inheritance diagram for PPPServer:

Public Member Functions

 PPPServer (uint16_t port, IPStack &stack)
 Server on the indicated stack.
 
 PPPServer (uint16_t port=80)
 Server on the default stack (the first TinyPPP instance)
 
PPPClient accept ()
 Returns a new connection (or an invalid client)
 
PPPClient available ()
 Returns a connection that has data available (or an invalid client)
 
void begin () override
 Starts listening.
 
void begin (uint16_t port)
 Starts listening on the indicated port.
 
void end ()
 Stops listening (open connections stay open)
 
 operator bool ()
 true if the server is listening
 
uint16_t port () const
 The server port.
 
size_t write (const uint8_t *buf, size_t size) override
 Writes data to all connected clients.
 
size_t write (uint8_t b) override
 Writes one byte to all connected clients.
 

Protected Member Functions

IPStack * stack () const
 

Protected Attributes

bool _listening = false
 
uint16_t _port
 
IPStack * _stack = nullptr
 

Detailed Description

TCP server over PPP: used like WiFiServer or EthernetServer.

Constructor & Destructor Documentation

◆ PPPServer() [1/2]

PPPServer ( uint16_t  port = 80)
inlineexplicit

Server on the default stack (the first TinyPPP instance)

◆ PPPServer() [2/2]

PPPServer ( uint16_t  port,
IPStack &  stack 
)
inline

Server on the indicated stack.

Member Function Documentation

◆ accept()

PPPClient accept ( )
inline

Returns a new connection (or an invalid client)

◆ available()

PPPClient available ( )
inline

Returns a connection that has data available (or an invalid client)

◆ begin() [1/2]

void begin ( )
inlineoverride

Starts listening.

◆ begin() [2/2]

void begin ( uint16_t  port)
inline

Starts listening on the indicated port.

◆ end()

void end ( )
inline

Stops listening (open connections stay open)

◆ operator bool()

operator bool ( )
inline

true if the server is listening

◆ port()

uint16_t port ( ) const
inline

The server port.

◆ stack()

IPStack * stack ( ) const
inlineprotected

◆ write() [1/2]

size_t write ( const uint8_t *  buf,
size_t  size 
)
inlineoverride

Writes data to all connected clients.

◆ write() [2/2]

size_t write ( uint8_t  b)
inlineoverride

Writes one byte to all connected clients.

Member Data Documentation

◆ _listening

bool _listening = false
protected

◆ _port

uint16_t _port
protected

◆ _stack

IPStack* _stack = nullptr
protected

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