class axl::io::Socket

#include <axl_io_Socket.h>

class Socket
{
public:
    // methods

    bool
    isOpen();

    bool
    open(
        int addressFamily,
        int sockKind,
        int protocol
        );

    void
    close();

    int
    getError();

    bool
    setBlockingMode(bool isBlocking);

    size_t
    getIncomingDataSize();

    bool
    bind(const sockaddr* addr);

    bool
    bind(const SockAddr& addr);

    bool
    getAddress(SockAddr* addr);

    bool
    getPeerAddress(SockAddr* addr);

    bool
    getOption(
        int level,
        int option,
        void* p,
        size_t size
        );

    bool
    setOption(
        int level,
        int option,
        const void* p,
        size_t size
        );

    bool
    listen(size_t backLog);

    bool
    accept(
        Socket* socket,
        SockAddr* addr = NULL
        );

    bool
    connect(const sockaddr* addr);

    bool
    connect(const SockAddr& addr);

    bool
    shutdown(SocketShutdownKind shutdownKind = SocketShutdownKind_All);

    size_t
    send(
        const void* p,
        size_t size
        );

    size_t
    recv(
        void* p,
        size_t size
        );

    size_t
    sendTo(
        void* p,
        size_t size,
        const sockaddr* addr
        );

    size_t
    sendTo(
        void* p,
        size_t size,
        const SockAddr& addr
        );

    size_t
    recvFrom(
        void* p,
        size_t size,
        SockAddr* addr
        );
};