|
| using | Ptr = std::unique_ptr <BasicStreamSocket <Protocol>> |
| |
| using | Mode = typename BasicDatagramSocket <Protocol>::Mode |
| |
| using | Option = typename BasicDatagramSocket <Protocol>::Option |
| |
| using | State = typename BasicDatagramSocket <Protocol>::State |
| |
| using | Endpoint = typename Protocol::Endpoint |
| |
| using | Ptr = std::unique_ptr <BasicDatagramSocket <Protocol>> |
| |
| using | Mode = typename BasicSocket <Protocol>::Mode |
| |
| using | Option = typename BasicSocket <Protocol>::Option |
| |
| using | State = typename BasicSocket <Protocol>::State |
| |
| using | Endpoint = typename Protocol::Endpoint |
| |
| enum | Mode { Blocking
, NonBlocking
} |
| | socket modes. More...
|
| |
| enum | Option {
NoDelay
, KeepAlive
, KeepIdle
, KeepIntvl
,
KeepCount
, SndBuffer
, RcvBuffer
, TimeStamp
,
ReuseAddr
, ReusePort
, Broadcast
, Ttl
,
MulticastLoop
, MulticastTtl
, PathMtuDiscover
, RcvError
,
AuxData
} |
| | socket options. More...
|
| |
| enum | State {
Connecting
, Connected
, Disconnecting
, Disconnected
,
Closed
} |
| | socket states. More...
|
| |
| using | Ptr = std::unique_ptr <BasicSocket <Protocol>> |
| |
| using | Endpoint = typename Protocol::Endpoint |
| |
|
| | BasicStreamSocket () |
| | default constructor.
|
| |
| | BasicStreamSocket (Mode mode) |
| | create instance specifying the mode.
|
| |
| | BasicStreamSocket (const BasicStreamSocket &other)=delete |
| | copy constructor.
|
| |
| BasicStreamSocket & | operator= (const BasicStreamSocket &other)=delete |
| | copy assignment operator.
|
| |
| | BasicStreamSocket (BasicStreamSocket &&other) |
| | move constructor.
|
| |
| BasicStreamSocket & | operator= (BasicStreamSocket &&other) |
| | move assignment operator.
|
| |
| virtual | ~BasicStreamSocket ()=default |
| | destroy the instance.
|
| |
| virtual bool | waitConnected (int timeout=0) |
| | block until connected.
|
| |
| virtual int | disconnect () override |
| | shutdown the connection.
|
| |
| virtual bool | waitDisconnected (int timeout=0) |
| | wait until the connection as been shut down.
|
| |
| int | readExactly (char *data, unsigned long size, int timeout=0) |
| | read data until size is reached or an error occurred.
|
| |
| int | readExactly (std::string &data, unsigned long size, int timeout=0) |
| | read data until size is reached or an error occurred.
|
| |
| int | writeExactly (const char *data, unsigned long size, int timeout=0) |
| | write data until size is reached or an error occurred.
|
| |
| virtual int | setOption (Option option, int value) noexcept override |
| | set the given option to the given value.
|
| |
| virtual bool | connecting () const noexcept |
| | check if the socket is connecting.
|
| |
| virtual bool | connected () noexcept override |
| | check if the socket is connected.
|
| |
| | BasicDatagramSocket (int ttl=60) |
| | Default constructor.
|
| |
| | BasicDatagramSocket (Mode mode, int ttl=60) |
| | Create instance specifying the mode.
|
| |
| | BasicDatagramSocket (const BasicDatagramSocket &other)=delete |
| | Copy constructor.
|
| |
| BasicDatagramSocket & | operator= (const BasicDatagramSocket &other)=delete |
| | Copy assignment operator.
|
| |
| | BasicDatagramSocket (BasicDatagramSocket &&other) |
| | Move constructor.
|
| |
| BasicDatagramSocket & | operator= (BasicDatagramSocket &&other) |
| | Move assignment operator.
|
| |
| virtual | ~BasicDatagramSocket ()=default |
| | Destroy the instance.
|
| |
| virtual int | open (const Protocol &protocol=Protocol()) noexcept override |
| | open socket using the given protocol.
|
| |
| virtual int | bindToDevice (const std::string &device) noexcept |
| | assigns the specified device to the socket.
|
| |
| virtual int | connect (const Endpoint &endpoint) |
| | make a connection to the given endpoint.
|
| |
| virtual void | close () noexcept override |
| | close the socket handle.
|
| |
| virtual int | read (char *data, unsigned long maxSize) noexcept override |
| | read data.
|
| |
| virtual int | readFrom (char *data, unsigned long maxSize, Endpoint *endpoint=nullptr) noexcept |
| | read data on the socket.
|
| |
| virtual int | write (const char *data, unsigned long maxSize) noexcept override |
| | write data.
|
| |
| virtual int | writeTo (const char *data, unsigned long maxSize, const Endpoint &endpoint) noexcept |
| | write data on the socket.
|
| |
| const Endpoint & | remoteEndpoint () const |
| | determine the remote endpoint associated with this socket.
|
| |
| int | mtu () const |
| | get socket mtu.
|
| |
| int | ttl () const |
| | returns the Time-To-Live value.
|
| |
| | BasicSocket () |
| | default constructor.
|
| |
| | BasicSocket (Mode mode) |
| | create socket instance specifying the mode.
|
| |
| | BasicSocket (const BasicSocket &other)=delete |
| | copy constructor.
|
| |
| BasicSocket & | operator= (const BasicSocket &other)=delete |
| | copy assignment operator.
|
| |
| | BasicSocket (BasicSocket &&other) |
| | move constructor.
|
| |
| BasicSocket & | operator= (BasicSocket &&other) |
| | move assignment operator.
|
| |
| virtual | ~BasicSocket () |
| | destroy the socket instance.
|
| |
| virtual int | bind (const Endpoint &endpoint) noexcept |
| | assigns the specified endpoint to the socket.
|
| |
| virtual int | canRead () const noexcept |
| | get the number of readable bytes.
|
| |
| virtual bool | waitReadyRead (int timeout=0) const noexcept |
| | block until new data is available for reading.
|
| |
| virtual bool | waitReadyWrite (int timeout=0) const noexcept |
| | block until at least one byte can be written.
|
| |
| void | setMode (Mode mode) noexcept |
| | set the socket to the non-blocking or blocking mode.
|
| |
| Endpoint | localEndpoint () const |
| | determine the local endpoint associated with this socket.
|
| |
| bool | opened () const noexcept |
| | check if the socket is opened.
|
| |
| virtual bool | encrypted () const noexcept |
| | check if the socket is secure.
|
| |
| int | family () const noexcept |
| | get socket address family.
|
| |
| int | type () const noexcept |
| | get the protocol communication semantic.
|
| |
| int | protocol () const noexcept |
| | get socket protocol.
|
| |
| int | handle () const noexcept override |
| | get socket native handle.
|
| |
Public Member Functions inherited from join::EventHandler |
| | EventHandler ()=default |
| | create instance.
|
| |
| virtual | ~EventHandler ()=default |
| | destroy instance.
|
| |
template<class Protocol>
class join::BasicStreamSocket< Protocol >
basic stream socket class.