mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
26 lines
604 B
C++
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 };
|
|
};
|
|
|