#include <Session.h>
Public Member Functions | |
virtual void | initiate () |
Initiate the session by connecting to the associated process. | |
virtual bool | initiated () const |
Returns whether this session has been initiated (that is, whether initiate() had been called in the past). | |
virtual string | getSocketType () const |
Returns the type of the socket that this session is served from, e.g. | |
virtual string | getSocketName () const |
Returns the address of the socket that this session is served from. | |
virtual int | getStream () const |
Returns this session's channel's file descriptor. | |
virtual void | setReaderTimeout (unsigned int msec) |
Set the timeout value for reading data from the I/O channel. | |
virtual void | setWriterTimeout (unsigned int msec) |
Set the timeout value for writing data from the I/O channel. | |
virtual void | shutdownReader () |
Indicate that we don't want to read data anymore from the I/O channel. | |
virtual void | shutdownWriter () |
Indicate that we don't want to write data anymore to the I/O channel. | |
virtual void | closeStream () |
Close the I/O stream. | |
virtual void | discardStream () |
Discard the I/O channel's file descriptor, so that the destructor won't automatically close it. | |
virtual pid_t | getPid () const |
Get the process ID of the application process that this session belongs to. | |
Protected Attributes | |
int | fd |
The session connection file descriptor. |
virtual void Passenger::StandardSession::closeStream | ( | ) | [inline, virtual] |
Close the I/O stream.
SystemException | Something went wrong. | |
boost::thread_interrupted |
Implements Passenger::Session.
virtual void Passenger::StandardSession::discardStream | ( | ) | [inline, virtual] |
Discard the I/O channel's file descriptor, so that the destructor won't automatically close it.
Implements Passenger::Session.
virtual string Passenger::StandardSession::getSocketName | ( | ) | const [inline, virtual] |
Returns the address of the socket that this session is served from.
This can be a Unix socket filename or a TCP host:port string like "127.0.0.1:1234".
Implements Passenger::Session.
virtual string Passenger::StandardSession::getSocketType | ( | ) | const [inline, virtual] |
Returns the type of the socket that this session is served from, e.g.
"unix" indicating a Unix socket.
Implements Passenger::Session.
virtual int Passenger::StandardSession::getStream | ( | ) | const [inline, virtual] |
Returns this session's channel's file descriptor.
This stream is full-duplex, and will be automatically closed upon Session's destruction, unless discardStream() is called.
Implements Passenger::Session.
virtual void Passenger::StandardSession::initiate | ( | ) | [inline, virtual] |
Initiate the session by connecting to the associated process.
A Session is not usable until it's initiated.
SystemException | Something went wrong. | |
IOException | Something went wrong. | |
boost::thread_interrupted |
Implements Passenger::Session.
virtual void Passenger::StandardSession::setReaderTimeout | ( | unsigned int | msec | ) | [inline, virtual] |
Set the timeout value for reading data from the I/O channel.
If no data can be read within the timeout period, then the read call will fail with error EAGAIN or EWOULDBLOCK.
msec | The timeout, in milliseconds. If 0 is given, there will be no timeout. |
SystemException | Cannot set the timeout. |
Implements Passenger::Session.
virtual void Passenger::StandardSession::setWriterTimeout | ( | unsigned int | msec | ) | [inline, virtual] |
Set the timeout value for writing data from the I/O channel.
If no data can be written within the timeout period, then the write call will fail with error EAGAIN or EWOULDBLOCK.
msec | The timeout, in milliseconds. If 0 is given, there will be no timeout. |
SystemException | Cannot set the timeout. |
Implements Passenger::Session.
virtual void Passenger::StandardSession::shutdownReader | ( | ) | [inline, virtual] |
Indicate that we don't want to read data anymore from the I/O channel.
Calling this method after closeStream()/discardStream() is called will have no effect.
SystemException | Something went wrong. | |
boost::thread_interrupted |
Implements Passenger::Session.
virtual void Passenger::StandardSession::shutdownWriter | ( | ) | [inline, virtual] |
Indicate that we don't want to write data anymore to the I/O channel.
Calling this method after closeStream()/discardStream() is called will have no effect.
SystemException | Something went wrong. | |
boost::thread_interrupted |
Implements Passenger::Session.
int Passenger::StandardSession::fd [protected] |
The session connection file descriptor.