simple-socket library 1.9.0
Loading...
Searching...
No Matches
UnixSeqPacketSocket.h
Go to the documentation of this file.
1#ifndef NET_UnixSeqPacketSocket_h__
2#define NET_UnixSeqPacketSocket_h__
3
4#include "UnixSocket.h"
5#include <optional>
6
7namespace NET
8{
11 {
12 public:
18
20
34 [[nodiscard]] static UnixSeqPacketSocket adoptNativeHandle( int sockfd);
35
40 [[nodiscard]] static std::pair<UnixSeqPacketSocket, UnixSeqPacketSocket>
41 createPair( bool nonBlocking = false);
42
43 // Listen for incoming connections
45
46 // Complete async connect attempt
48
59 [[nodiscard]] std::optional<UnixSeqPacketSocket> accept() const;
60
70 [[nodiscard]] std::optional<UnixSeqPacketSocket> timedAccept( int timeout) const;
71
72 protected:
73 // allow construction by accept()
75 };
76
77} // namespace NET
78
79#endif // NET_UnixSeqPacketSocket_h__
void listen(int backlog=128)
listen for incoming connections
ConnectResult finishConnect(int timeout=0)
check if a previously started connected attempt is finished
std::optional< UnixSeqPacketSocket > accept() const
UnixSocket(int type, int protocol)
allows a subclass to create new socket
std::optional< UnixSeqPacketSocket > timedAccept(int timeout) const
static std::pair< UnixSeqPacketSocket, UnixSeqPacketSocket > createPair(bool nonBlocking=false)
static UnixSeqPacketSocket adoptNativeHandle(int sockfd)
Take ownership of an existing native Unix seqpacket socket descriptor.
UnixSocket(int type, int protocol)
allows a subclass to create new socket