ladybird/Kernel/Socket.h

27 lines
604 B
C
Raw Normal View History

#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 };
};