16#include <netinet/in.h>
17#include <sys/socket.h>
63 unsigned int len = bufferLength;
64 if(mFlow->
receive(buffer, len, 0))
75 UtlString* ipAddress,
int* port)
77 asio::ip::address receivedAddress;
78 unsigned short receivedPort=0;
83 unsigned int len = bufferLength;
84 if(mFlow->
receive(buffer, len, 0, &receivedAddress, &receivedPort))
92 *ipAddress = receivedAddress.to_string().c_str();
97 *port = (int)receivedPort ;
105 struct in_addr* ipAddress,
int* port)
109 UtlString receivedIp;
111 iRC =
read(buffer, bufferLength, &receivedIp, &iReceivedPort) ;
122 *port = iReceivedPort ;
131 unsigned int len = bufferLength;
132 if(mFlow->
receive(buffer, len, waitMilliseconds))
143 mFlow->
send((
char *)buffer, bufferLength);
149 const char* ipAddress,
154 mFlow->
sendTo(asio::ip::make_address(ipAddress), port, (
char*)buffer, bufferLength);
159 long waitMilliseconds)
163 mFlow->
send((
char*)buffer, bufferLength);
#define resip_assert(x)
This file needs to work for both C and C++ code.
Handles cross-platform sockets compatibility.
This class represents a Flow that is created by the Flow Manager.
unsigned int getSocketDescriptor()
void send(char *buffer, unsigned int size)
Turn Send Methods WARNING - if using Secure media, then there must be room at the end of the passed i...
void sendTo(const asio::ip::address &address, unsigned short port, char *buffer, unsigned int size)
asio::error_code receive(char *buffer, unsigned int &size, unsigned int timeout, asio::ip::address *sourceAddress=0, unsigned short *sourcePort=0)
Receive Methods.
unsigned int getSelectSocketDescriptor()
Returns a socket descriptor that can be used in a select call WARNING - this descriptor should not be...
virtual int getSocketDescriptor() const
virtual ~FlowManagerSipXSocket()
virtual int read(char *buffer, int bufferLength)
virtual int write(const char *buffer, int bufferLength)
virtual OsSocket * getSocket()
FlowManagerSipXSocket(Flow *flow, int tos)
static int inet_pton(const Data &printableIp, struct in_addr &dst)
Convert from the presentation format of the IPv4 address to struct in_addr.