modified by ohneta

Dependents:   HelloESP8266Interface_mine

Fork of NetworkSocketAPI by NetworkSocketAPI

Embed: (wiki syntax)

« Back to documentation index

Endpoint Class Reference

Endpoint Class Reference

Base class that defines an endpoint (TCP/UDP/Server/Client Socket) More...

#include <SocketInterface.h>

Inherited by SocketInterface.

Public Member Functions

virtual const char * getHostByName (const char *name) const =0
 Get the ip address of a host by DNS lookup.
virtual void setAddress (const char *addr)=0
 Set the address of this endpoint.
virtual void setPort (uint16_t port)=0
 Set the port of this endpoint.
virtual void setAddressPort (const char *addr, uint16_t port)=0
 Set the address and port of this endpoint.
virtual const char * getAddress (void) const =0
 Get the IP address of this endpoint.
virtual uint16_t getPort (void) const =0
 Get the port of this endpoint.

Detailed Description

Base class that defines an endpoint (TCP/UDP/Server/Client Socket)

Definition at line 47 of file SocketInterface.h.


Member Function Documentation

virtual const char* getAddress ( void   ) const [pure virtual]

Get the IP address of this endpoint.

Returns:
The IP address of this endpoint.
virtual const char* getHostByName ( const char *  name ) const [pure virtual]

Get the ip address of a host by DNS lookup.

Parameters:
nameThe name of a host you need an ip address for
Returns:
The ip address of the host otherwise NULL
virtual uint16_t getPort ( void   ) const [pure virtual]

Get the port of this endpoint.

Returns:
The port of this socket
virtual void setAddress ( const char *  addr ) [pure virtual]

Set the address of this endpoint.

Parameters:
addrThe endpoint address
Returns:
0 on success, -1 on failure (when an hostname cannot be resolved by DNS).
virtual void setAddressPort ( const char *  addr,
uint16_t  port 
) [pure virtual]

Set the address and port of this endpoint.

Parameters:
addrThe endpoint address (supplied as an ip address).
portThe endpoint port
Returns:
0 on success, -1 on failure (when an hostname cannot be resolved by DNS).
virtual void setPort ( uint16_t  port ) [pure virtual]

Set the port of this endpoint.

Parameters:
portThe endpoint port
Returns:
0 on success, -1 on failure (when an hostname cannot be resolved by DNS).