39#include "blocxx/BLOCXX_config.h"
41#if !defined(BLOCXX_WIN32)
56#ifdef BLOCXX_HAVE_UNISTD_H
59#include <sys/socket.h>
66#if defined(BLOCXX_DARWIN)
70#include <sys/utsname.h>
164 int const BUFSZ = 64 * 1024;
171#if defined(BLOCXX_DARWIN)
193 String release(
unamerv.release);
206 catch (StringConversionException&
e)
237AcceptThread::acceptConnection()
245 (
char*) &
tmp,
sizeof(
int));
255 (
char *) &
tmp,
sizeof(
int));
258 (
char*) &
tmp,
sizeof(
int));
279 sin.sin_addr.s_addr =
htonl( 0x7f000001 );
286 fprintf(
stderr,
"CreateSocket(): Failed to bind on socket" );
299 fprintf(
stderr,
"CreateSocket(): Failed to obtain socket name" );
320 csin.sin_addr.s_addr =
htonl(0x7f000001);
342 fds[0] =
pat->getConnectFD();
414 for (
size_t i = 0;
i < 2; ++
i)
442#if defined(BLOCXX_NETWARE)
653#if defined(BLOCXX_DARWIN)
715#if defined(BLOCXX_DARWIN)
#define BLOCXX_ASSERT(CON)
BLOCXX_ASSERT works similar to the assert() macro, but instead of calling abort(),...
#define BLOCXX_THROW(exType, msg)
Throw an exception using FILE and LINE.
#define BLOCXX_THROW_ERRNO_MSG(exType, msg)
Throw an exception using FILE, LINE, errno and strerror(errno)
#define BLOCXX_GLOBAL_STRING_INIT(str)
#define BLOCXX_LOG_ERROR(logger, message)
Log message to logger with the Error level.
#define BLOCXX_INVALID_HANDLE
PURPOSE: The AutoResource class template is an analog of std::auto_ptr for managing arbitrary resourc...
virtual int read(void *buffer, int bufferLen, ErrorAction errorAsException=E_RETURN_ON_ERROR)
Read a specified number of bytes from the device that is exposing the IOIFC interface.
virtual Select_t getWriteSelectObj() const
Get the write select object.
virtual void setBlocking(EBlockingMode outputIsBlocking=E_BLOCKING)
Set the pipe's blocking mode.
virtual void setReadBlocking(EBlockingMode isBlocking=E_BLOCKING)
Set blocking mode for reading from pipe.
virtual void setWriteBlocking(EBlockingMode isBlocking=E_BLOCKING)
Set blocking mode for writing to pipe.
virtual ~PosixUnnamedPipe()
virtual int close()
Close the pipe.
virtual EBlockingMode getReadBlocking() const
Get the current blocking mode for reading from pipe.
virtual bool isOpen() const
Is the pipe open or closed?
virtual EBlockingMode getWriteBlocking() const
Get the current blocking mode for writing from pipe.
virtual int write(const void *data, int dataLen, ErrorAction errorAsException=E_RETURN_ON_ERROR)
Write a specified number of bytes to the device that is exposing the IOIFC interface.
virtual Select_t getReadSelectObj() const
Get the read select object.
virtual AutoDescriptor receiveDescriptor(const UnnamedPipeRef &ackPipe)
Gets a Descriptor from the peer.
virtual int closeOutputHandle()
virtual Descriptor getOutputDescriptor() const
Get the underlying output descriptor.
virtual Descriptor getInputDescriptor() const
Get the underlying input descriptor.
virtual void open()
Open the pipe.
virtual int closeInputHandle()
virtual void passDescriptor(Descriptor h, const UnnamedPipeRef &ackPipe=0, const ProcessRef &targetProcess=0)
Sends a Descriptor to the peer.
EBlockingMode m_blocking[2]
PosixUnnamedPipe(EOpen doOpen=E_OPEN)
static void testCancel()
Test if this thread has been cancelled.
static Timeout relative(float seconds)
void setTimeouts(const Timeout &timeout)
Sets the read & write timeout values.
Timeout getReadTimeout()
Gets the read timeout value.
Timeout getWriteTimeout()
Gets the write timeout value.
GlobalString COMPONENT_NAME
int waitForIO(SocketHandle_t fd, int timeOutSecs, SocketFlags::EWaitDirectionFlag waitFlag)
Wait for input or output on a socket.
void BLOCXX_COMMON_API callOnce(OnceFlag &flag, FuncT F)
The first time callOnce is called with a given onceFlag argument, it calls func with no argument and ...
LazyGlobal< String, char const *const > GlobalString
Array< String > StringArray
bool operator==(const Array< T > &x, const Array< T > &y)
class BLOCXX_COMMON_API Logger