simple-socket library 1.9.0
Loading...
Searching...
No Matches
UnixSocket.h
Go to the documentation of this file.
1#ifndef NET_UnixSocket_h__
2#define NET_UnixSocket_h__
3
4#include "SimpleSocket.h"
5
6namespace NET
7{
9
12 class UnixSocket : public SimpleSocket
13 {
14 public:
16
23 ConnectResult connect( std::string_view foreignPath);
24
30 void bind( std::string_view localPath);
31
37 std::string getLocalPath() const;
38
44 std::string getForeignPath() const;
45
48 {
49 pid_t pid; // process id (-1 if unavailable)
50 uid_t uid; // effective user ID
51 gid_t gid; // effective group ID
52 };
53
59
60 protected:
62 UnixSocket( int type, int protocol);
63
65 UnixSocket( AdoptSocketTag, int sockfd, int type);
66
67 UnixSocket( UnixSocket&& other) noexcept;
68 UnixSocket& operator=( UnixSocket&& other) noexcept;
69
70 // track created socket file
71 std::string m_boundPath;
72 };
73
74} // namespace NET
75
76#endif // NET_UnixSocket_h__
SimpleSocket(const SimpleSocket &)=delete
std::string getForeignPath() const
std::string m_boundPath
Definition UnixSocket.h:71
ConnectResult connect(std::string_view foreignPath)
UnixSocket(int type, int protocol)
allows a subclass to create new socket
void bind(std::string_view localPath)
UnixSocket & operator=(UnixSocket &&other) noexcept
std::string getLocalPath() const
UnixSocket(UnixSocket &&other) noexcept
UnixSocket(AdoptSocketTag, int sockfd, int type)
allows a subclass to take ownership of an existing socket
PeerCredentials peerCredentials() const
ConnectResult
result of the connection attempt
used to safely adopt internal socket descriptor
Unix credentials of a socket peer.
Definition UnixSocket.h:48