simple-socket library 1.9.0
Loading...
Searching...
No Matches
UnixDatagramSocket.h
Go to the documentation of this file.
1#ifndef NET_UnixDatagramSocket_h__
2#define NET_UnixDatagramSocket_h__
3
4#include "UnixSocket.h"
5
6namespace NET
7{
10 {
11 public:
17
19
33 [[nodiscard]] static UnixDatagramSocket adoptNativeHandle( int sockfd);
34
39 [[nodiscard]] static std::pair<UnixDatagramSocket, UnixDatagramSocket>
40 createPair( bool nonBlocking = false);
41
51 IOResult sendTo( const void* buffer, size_t len, std::string_view foreignPath);
52
63 IOResult receiveFrom( void* buffer, size_t len, std::string& sourcePath);
64
78 IOResult timedReceiveFrom( void* buffer, size_t len, std::string& sourcePath, int timeout);
79
80 protected:
81 // allow construction by adopt
83 };
84
85} // namespace NET
86
87#endif // NET_UnixDatagramSocket_h__
IOResult receiveFrom(void *buffer, size_t len, std::string &sourcePath)
IOResult timedReceiveFrom(void *buffer, size_t len, std::string &sourcePath, int timeout)
static std::pair< UnixDatagramSocket, UnixDatagramSocket > createPair(bool nonBlocking=false)
IOResult sendTo(const void *buffer, size_t len, std::string_view foreignPath)
UnixSocket(int type, int protocol)
allows a subclass to create new socket
static UnixDatagramSocket adoptNativeHandle(int sockfd)
Take ownership of an existing native Unix datagram socket descriptor.
UnixSocket(int type, int protocol)
allows a subclass to create new socket