38 #include <netinet/in.h>
86 UDPPort (std::map<std::string, std::string> options);
96 ssize_t Read (
void *
const buffer,
size_t count);
98 ssize_t ReadFull (
void *
const buffer,
size_t count);
100 ssize_t ReadUntil (
void *
const buffer,
size_t count, uint8_t terminator);
102 ssize_t ReadStringUntil (std::string &buffer,
char terminator);
104 ssize_t Skip (
size_t count);
107 ssize_t SkipUntil (uint8_t terminator,
unsigned int count);
109 ssize_t BytesAvailable ();
111 ssize_t BytesAvailableWait ();
113 ssize_t Write (
const void *
const buffer,
size_t count);
119 std::string GetStatus ()
const;
121 void SetTimeout (
Timeout timeout);
123 void SetCanRead (
bool canRead);
125 void SetCanWrite (
bool canWrite);
131 #if defined (FLEXIPORT_HAVE_GETADDRINFO)
132 struct sockaddr _destSockAddr;
134 struct sockaddr_in _destSockAddr;
136 #endif // !defined (WIN32)
141 unsigned int _destPort;
143 unsigned int _recvPort;
146 void CheckPort (
bool read);
148 bool ProcessOption (
const std::string &option,
const std::string &value);
152 void OpenReceiver ();
153 void CloseReceiver ();
154 typedef enum {TIMED_OUT, DATA_AVAILABLE, CAN_WRITE} WaitStatus;
155 WaitStatus WaitForDataOrTimeout ();
156 bool IsDataAvailable ();
157 WaitStatus WaitForWritableOrTimeout ();
158 void SetSocketBlockingFlag ();
165 #endif // __UDPPORT_H
bool IsOpen() const
Check if the port is open.
UDP implementation of the Port class.
An object used to represent timeouts.