32 #include "flexiport_config.h"
37 #include <netinet/in.h>
80 UDPPort (std::map<std::string, std::string> options);
90 ssize_t Read (
void *
const buffer,
size_t count);
92 ssize_t ReadFull (
void *
const buffer,
size_t count);
94 ssize_t ReadUntil (
void *
const buffer,
size_t count, uint8_t terminator);
96 ssize_t ReadStringUntil (std::string &buffer,
char terminator);
98 ssize_t Skip (
size_t count);
101 ssize_t SkipUntil (uint8_t terminator,
unsigned int count);
103 ssize_t BytesAvailable ();
105 ssize_t BytesAvailableWait ();
107 ssize_t Write (
const void *
const buffer,
size_t count);
113 std::string GetStatus ()
const;
115 void SetTimeout (
Timeout timeout);
117 void SetCanRead (
bool canRead);
119 void SetCanWrite (
bool canWrite);
125 #if defined (FLEXIPORT_HAVE_GETADDRINFO)
126 struct sockaddr _destSockAddr;
128 struct sockaddr_in _destSockAddr;
135 unsigned int _destPort;
137 unsigned int _recvPort;
140 void CheckPort (
bool read);
142 bool ProcessOption (
const std::string &option,
const std::string &value);
146 void OpenReceiver ();
147 void CloseReceiver ();
148 typedef enum {TIMED_OUT, DATA_AVAILABLE, CAN_WRITE} WaitStatus;
149 WaitStatus WaitForDataOrTimeout ();
150 bool IsDataAvailable ();
151 WaitStatus WaitForWritableOrTimeout ();
152 void SetSocketBlockingFlag ();
Base Port class.
Definition: port.h:80
An object used to represent timeouts.
Definition: timeout.h:63
UDP implementation of the Port class. This class provides UDP communication between two known end poi...
Definition: udpport.h:78
bool IsOpen() const
Check if the port is open.
Definition: udpport.h:121
FlexiPort data communications library.