Open Lighting Architecture  0.9.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
ola::io::UnixSocket Class Reference

Detailed Description

A unix domain socket pair.

Inheritance diagram for ola::io::UnixSocket:
Inheritance graph
[legend]
Collaboration diagram for ola::io::UnixSocket:
Collaboration graph
[legend]

Public Member Functions

bool Init ()
 Initialize the UnixSocket.
UnixSocketOppositeEnd ()
 Fetch the other end of the unix socket.
DescriptorHandle ReadDescriptor () const
 Returns the read descriptor for this socket.
DescriptorHandle WriteDescriptor () const
 Returns the write descriptor for this socket.
bool Close ()
 Close this UnixSocket.
bool CloseClient ()
 Close the write portion of this UnixSocket.
- Public Member Functions inherited from ola::io::ConnectedDescriptor
virtual ssize_t Send (const uint8_t *buffer, unsigned int size)
 Write a buffer to the descriptor.
virtual ssize_t Send (IOQueue *data)
 Write data from an IOQueue to a descriptor.
virtual int Receive (uint8_t *buffer, unsigned int size, unsigned int &data_read)
 Read data from this descriptor.
virtual bool SetReadNonBlocking ()
 Enable on non-blocking reads..
int DataRemaining () const
 Find out how much data is left to read.
bool IsClosed () const
 Check if the descriptor is closed.
void SetOnClose (OnCloseCallback *on_close)
 Set the callback to be run when the descriptor is closed.
OnCloseCallbackTransferOnClose ()
 Take ownership of the on_close callback.
- Public Member Functions inherited from ola::io::BidirectionalFileDescriptor
void SetOnData (ola::Callback0< void > *on_read)
 Set the callback to be run when data is available for reading.
void SetOnWritable (ola::Callback0< void > *on_write)
 Set the callback to be run when the descriptor can be written to.
void PerformRead ()
 Called when there is data available on the descriptor.
void PerformWrite ()
 Called when the descriptor can be written to.
- Public Member Functions inherited from ola::io::ReadFileDescriptor
bool ValidReadDescriptor () const
 Check if this file descriptor is valid.
- Public Member Functions inherited from ola::io::WriteFileDescriptor
bool ValidWriteDescriptor () const
 Check if this file descriptor is valid.

Protected Member Functions

bool IsSocket () const
- Protected Member Functions inherited from ola::io::ConnectedDescriptor
bool SetNoSigPipe (DescriptorHandle fd)
 Disable SIGPIPE for this descriptor.

Additional Inherited Members

- Public Types inherited from ola::io::ConnectedDescriptor
typedef
ola::SingleUseCallback0< void > 
OnCloseCallback
- Static Public Member Functions inherited from ola::io::ConnectedDescriptor
static bool SetNonBlocking (DescriptorHandle fd)
 Set a DescriptorHandle to non-blocking mode.

Member Function Documentation

UnixSocket * ola::io::UnixSocket::OppositeEnd ( )

Fetch the other end of the unix socket.

Returns
A new UnixSocket or NULL if the socket wasn't initialized correctly. Its an error to call this more than once. Ownership of the returned UnixSocket is transferred to the caller.
DescriptorHandle ola::io::UnixSocket::ReadDescriptor ( ) const
inlinevirtual

Returns the read descriptor for this socket.

Returns
the DescriptorHandle for this descriptor.

Implements ola::io::ReadFileDescriptor.

DescriptorHandle ola::io::UnixSocket::WriteDescriptor ( ) const
inlinevirtual

Returns the write descriptor for this socket.

Returns
the DescriptorHandle for this descriptor.

Implements ola::io::WriteFileDescriptor.


The documentation for this class was generated from the following files: