1#if defined(HAVE_CONFIG_H)
12#define RESIPROCATE_SUBSYSTEM Subsystem::TRANSPORT
16 :
Connection(transport,who, fd, compression, isServer)
18 DebugLog (<<
"Creating TCP connection " <<
who <<
" on " << fd);
28 int bytesRead = ::recv(
getSocket(), buf, count, 0);
39#if EAGAIN != EWOULDBLOCK
42 StackLog (<<
"No data ready to read");
45 DebugLog (<<
"The call was interrupted by a signal before any data was read.");
52 InfoLog (<<
"fd is not a valid file descriptor or is not open for reading.");
55 InfoLog (<<
"fd is attached to an object which is unsuitable for reading.");
58 ErrLog (<<
"buf is outside your accessible address space.");
61 ErrLog (<<
"Some other error, code = " << e);
74 else if (bytesRead == 0)
76 InfoLog (<<
"Connection closed by remote " << *
this);
93 int bytesWritten = ::send(
getSocket(), buf, count, 0);
102 if (e == EAGAIN || e == EWOULDBLOCK)
#define resip_assert(x)
This file needs to work for both C and C++ code.
Handles cross-platform sockets compatibility.
void setFailureReason(TransportFailure::FailureReason failReason, int subCode, const Data &failureString)
Connection implements, via sockets, ConnectionBase for managed connections.
int read()
move data from the connection to the buffer; move this to front of least recently used list.
An iostream that operates on an existing Data.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
virtual bool hasDataToRead()
always true – always add to fdset as read ready
virtual bool isGood()
has valid connection
int write(const char *buf, const int count)
pure virtual, but need concrete Connection for book-ends of lists
virtual bool isWritable()
The base class for Transport classes.
static Data errorToString(int e)
static void error(int e)
Generates a generic log for the platform specific socket error number.
Represents a network address.
dcm! – add UnusedChecking(_enum) below;
std::string strError(int err)