A bidirectional TCP connection (either a client connection or returned by ATcpServerSocket).
More...
#include <AUI/Network/ATcpSocket.h>
|
| ATcpSocket (const AInet4Address &destinationAddress) |
|
size_t | read (char *dst, size_t size) override |
| Reads up to size bytes from stream. Blocking (waiting for new data) is allowed.
|
|
void | write (const char *buffer, size_t size) override |
| Writes exact size bytes to stream. Blocking (waiting for write all data) is allowed.
|
|
| AAbstractSocket (const AAbstractSocket &)=delete |
|
void | close () |
|
void | setTimeout (int secs) |
|
const AInet4Address & | getAddress () const |
|
size_t | read (std::span< std::byte > destination) |
| Reads up to destination.size() bytes from stream. Blocking (waiting for new data) is allowed.
|
|
void | readExact (char *dst, size_t size) |
| Reads exact size bytes from stream. Blocking (waiting for new data) is allowed.
|
|
template<typename T> |
T | deserialize () |
|
template<typename T> |
IInputStream & | operator>> (T &dst) |
|
template<typename T> |
IInputStream & | operator>> (T &&dst) |
|
template<typename T> |
void | write (const T &t) |
|
template<typename T> |
IOutputStream & | operator<< (const T &t) |
|
|
static AString | getErrorString () |
|
static void | handleError (const AString &message, int code) |
|
A bidirectional TCP connection (either a client connection or returned by ATcpServerSocket).
◆ createSocket()
int ATcpSocket::createSocket |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ read()
size_t ATcpSocket::read |
( |
char * | dst, |
|
|
size_t | size ) |
|
overridevirtual |
Reads up to size
bytes from stream. Blocking (waiting for new data) is allowed.
- Sneaky exceptions
- An implementation can throw any exception that subclasses AIOException.
- Parameters
-
dst | destination buffer |
size | destination buffer's size. > 0 |
- Returns
- number of read bytes (including 0)
Implements IInputStream.
◆ write()
void ATcpSocket::write |
( |
const char * | src, |
|
|
size_t | size ) |
|
overridevirtual |
Writes exact size
bytes to stream. Blocking (waiting for write all data) is allowed.
- Sneaky exceptions
- An implementation can throw any exception that subclasses AIOException.
- Parameters
-
src | source buffer |
size | source buffer's size. > 0 |
Implements IOutputStream.
The documentation for this class was generated from the following files:
- aui.network/src/AUI/Network/ATcpSocket.h
- aui.network/src/AUI/Network/ATcpSocket.cpp