Go to the documentation of this file.
12 #ifndef IPV4_SOCKET_Hh
13 #define IPV4_SOCKET_Hh
74 bool open(
const int domain_);
123 int read (
char* buf_,
const unsigned int size_);
131 int write (
const char* buf_,
const unsigned int size_);
181 #endif // IPV4_SOCKET_Hh
int write(const char *buf_, const unsigned int size_)
Perform blocking write by writing packet of specified size.
static const int MAXTCPBUFSZ
Maximum TCP data frame (no options)
int in_avail()
This function returns the number of characters immediately available in the get area.
virtual Streambuf * rdbuf()
Return a pointer to the Socketbuf associated with the stream.
IPv4Socket & operator=(const IPv4Socket &)
bool open(const int domain_)
Create socket.
Streambuf * m_rdbuf
Socketbuf.
IPv4Socket * accept()
Accept connection on the listening socket.
handler_t m_fd
File descriptor.
~IPv4Socket()
Destructor will close connection.
bool connect(const Address &address_)
Client makes connection with the server at address_.
IPv4Socket * clone() const
"Virtual constructor".
char * m_path
Path of UNIX domain socket.
IPv4Socket(const handler_t fd_)
Constructor from file descriptor.
bool close()
Close socket connection.
int read(char *buf_, const unsigned int size_)
Read packet of specified size and save it to the given buffer.
handler_t getHandler() const
Get socket file descriptor.
int m_type
Socket domain type.
virtual bool bind(const Address &my_address_)
Server binds listening socket to its local well-known port.
@ SOCKTRACE
Extended Socket & friends messages
virtual int in_avail() const
This function returns the number of characters immediately available in the get area of the underlyin...
IPv4Socket()
Default constructor.
const int getDomain() const
Get socket domain type.
#define trace_with_mask(s, m)