client socket
More...
#include <socket.h>
|
bool | connect (const std::string &host, int port) |
| connect to given port of given host, if the socket is already connected, close this connection first
|
|
std::string | get_last_error () const |
| returns the last error
|
|
bool | is_data_pending () const |
| return whether data has arrived
|
|
int | get_nr_of_arrived_bytes () const |
| return the number of data bytes that have been arrived at the socket or -1 if socket is not connected More...
|
|
std::string | receive_line () |
| receive data up to the next newline excluding the newline char
|
|
std::string | receive_data (unsigned int nr_of_bytes=0) |
| receive all pending data or if nr_of_bytes is larger than 0, exactly nr_of_bytes
|
|
bool | send_line (const std::string &content) |
| extends line by newline and send as data
|
|
bool | send_data (const std::string &) |
| send the data in the string
|
|
bool | close () |
| close the socket
|
|
int | get_ref_count () const |
| read access to current count
|
|
|
static void | enable_debug_output (bool enable=true) |
| enables or disables (default) debug output for all socket commands
|
|
|
| socket_client () |
| hide from direct use
|
|
bool | set_last_error (const char *location, const std::string &text="") const |
| convenience function to set last error and print debug info. The method always returns false.
|
|
void | set_ref_count (int c) const |
| write access is also const to allow ref counted pointers to const instances
|
|
|
size_t | user_data |
| store platform dependent reference to socket
|
|
std::string | last_error |
| store the last error
|
|
◆ get_nr_of_arrived_bytes()
int cgv::os::socket::get_nr_of_arrived_bytes |
( |
| ) |
const |
|
inherited |
return the number of data bytes that have been arrived at the socket or -1 if socket is not connected
return the number of data bytes that have been arrived at the socket
The documentation for this class was generated from the following files:
- D:/develop/projects/git/cgv/cgv/os/socket.h
- D:/develop/projects/git/cgv/cgv/os/socket.cxx