blob: 9ed1abb06553f29761dcdf8f0a33e2ad8115bc63 [file] [log] [blame]
#pragma once
#include <sys/types.h>
namespace net
{
class SockIO
{
public:
SockIO() = default;
explicit SockIO(int sockfd) : sockfd_{sockfd}
{}
virtual ~SockIO();
int get_sockfd() const
{
return sockfd_;
}
virtual int write(const void* buf, size_t len);
virtual int close();
virtual int recv(void* buf, size_t maxlen);
protected:
int sockfd_ = -1;
};
} // namespace net