ladybird/Kernel/Socket.h
2019-02-14 14:38:30 +01:00

26 lines
604 B
C++

#pragma once
#include <AK/Retainable.h>
#include <AK/RetainPtr.h>
#include <Kernel/UnixTypes.h>
class Socket : public Retainable<Socket> {
public:
static RetainPtr<Socket> create(int domain, int type, int protocol, int& error);
virtual ~Socket();
int domain() const { return m_domain; }
int type() const { return m_type; }
int protocol() const { return m_protocol; }
virtual bool bind(const sockaddr*, socklen_t, int& error) = 0;
protected:
Socket(int domain, int type, int protocol);
private:
int m_domain { 0 };
int m_type { 0 };
int m_protocol { 0 };
};