Poster of Linux kernelThe best gift for a Linux geek
ost::UnixSession

ost::UnixSession

Section: C Library Functions (3) Updated: 16 Feb 2010
Local index Up
 

NAME

ost::UnixSession -

The Unix domain session is used to primarily to represent a client connection that can be managed on a seperate thread.

 

SYNOPSIS


#include <unix.h>

Inherits ost::Thread, and ost::UnixStream.  

Public Member Functions


UnixSession (const char *pathname, int size=512, int pri=0, int stack=0)
Create a Unix domain socket that will be connected to a local server server and that will execute under it's own thread.
UnixSession (UnixSocket &server, int size=512, int pri=0, int stack=0)
Create a Unix domain socket from a bound Unix domain server by accepting a pending connection from that server and execute a thread for the accepted connection.
virtual ~UnixSession ()
Virtual destructor.  

Protected Member Functions


int waitConnection (timeout_t timeout=~((timeout_t) 0))
Normally called during the thread Initial() method by default, this will wait for the socket connection to complete when connecting to a remote socket.
void initial (void)
The initial method is used to esablish a connection when delayed completion is used.  

Detailed Description

The Unix domain session is used to primarily to represent a client connection that can be managed on a seperate thread.

The Unix domain session also supports a non-blocking connection scheme which prevents blocking during the constructor and moving the process of completing a connection into the thread that executes for the session.

Author:

Alex Pavloff <alex@pavloff.net> Threaded streamable unix domain socket with non-blocking constructor.

 

Constructor & Destructor Documentation

 

ost::UnixSession::UnixSession (const char * pathname, int size = 512, int pri = 0, int stack = 0)

Create a Unix domain socket that will be connected to a local server server and that will execute under it's own thread. Parameters:

pathname path to socket
size of streaming buffer.
pri execution priority relative to parent.
stack allocation needed on some platforms.

 

ost::UnixSession::UnixSession (UnixSocket & server, int size = 512, int pri = 0, int stack = 0)

Create a Unix domain socket from a bound Unix domain server by accepting a pending connection from that server and execute a thread for the accepted connection. Parameters:

server unix domain socket to accept a connection from.
size of streaming buffer.
pri execution priority relative to parent.
stack allocation needed on some platforms.

 

virtual ost::UnixSession::~UnixSession () [virtual]

Virtual destructor.  

Member Function Documentation

 

void ost::UnixSession::initial (void) [protected, virtual]

The initial method is used to esablish a connection when delayed completion is used. This assures the constructor terminates without having to wait for a connection request to complete.

Reimplemented from ost::Thread.  

int ost::UnixSession::waitConnection (timeout_t timeout = ~((timeout_t) 0)) [protected]

Normally called during the thread Initial() method by default, this will wait for the socket connection to complete when connecting to a remote socket. One might wish to use setCompletion() to change the socket back to blocking I/O calls after the connection completes. To implement the session one must create a derived class which implements Run().

Returns:

0 if successful, -1 if timed out.

Parameters:

timeout to wait for completion in milliseconds.

 

Author

Generated automatically by Doxygen for GNU CommonC++ from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Protected Member Functions
Detailed Description
Constructor & Destructor Documentation
ost::UnixSession::UnixSession (const char * pathname, int size = 512, int pri = 0, int stack = 0)
ost::UnixSession::UnixSession (UnixSocket & server, int size = 512, int pri = 0, int stack = 0)
virtual ost::UnixSession::~UnixSession () [virtual]
Member Function Documentation
void ost::UnixSession::initial (void) [protected, virtual]
int ost::UnixSession::waitConnection (timeout_t timeout = ~((timeout_t) 0)) [protected]
Author

This document was created by man2html, using the manual pages.
Time: 21:51:53 GMT, April 16, 2011