30 class internet_address;
39 class spocket :
public virtual basis::root_object
72 OKAY = basis::common::OKAY,
80 NO_ANSWER = sockets::communication_commons::NO_ANSWER,
82 DEFINE_OUTCOME(NOT_SERVER, -39,
"Accept was tried on a spocket that is "
168 int size,
int &len_sent);
Provides a dynamically resizable ASCII character string.
A very common template for a dynamic array of bytes.
Outcomes describe the state of completion for an operation.
this type of address describes a destination out on the internet.
Abstraction for a higher-level BSD socket that is platform independent.
basis::outcome await_writable(int timeout)
bool was_connected() const
tcpip_stack & stack() const
spocket(const internet_address &where, sock_types type=CONNECTED)
basis::outcome send(const basis::abyte *buffer, int size, int &len_sent)
basis::astring text_form()
basis::outcome connect(int communication_wait=20 *basis::SECOND_ms)
static const char * outcome_name(const basis::outcome &to_name)
basis::un_int OS_socket()
basis::outcome receive_from(basis::abyte *buffer, int &size, internet_address &where_from)
bool is_root_server() const
basis::outcome send_to(const internet_address &where_to, const basis::abyte *buffer, int size, int &len_sent)
basis::outcome accept(spocket *&sock, bool wait)
const internet_address & remote() const
void bind_client(const internet_address &source)
when a client calls connect, this forces it to bind to "source".
basis::outcome disconnect()
basis::outcome await_readable(int timeout)
bool is_bogus() const
returns true when this object is bogus.
basis::un_int OS_root_socket()
DEFINE_CLASS_NAME("spocket")
const internet_address & where() const
basis::outcome receive(basis::abyte *buffer, int &size)
Helpful functions for interacting with TCP/IP stacks.
Represents a point in time relative to the operating system startup time.
unsigned char abyte
A fairly important unit which is seldom defined...
const int SECOND_ms
Number of milliseconds in a second.
unsigned int un_int
Abbreviated name for unsigned integers.
Provides access to the operating system's socket methods.