Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

vpr::SocketBasicOpt Class Reference

Options common to all types of sockets. More...

#include <SocketBasicOpt.h>

Inheritance diagram for vpr::SocketBasicOpt:

Inheritance graph
[legend]
Collaboration diagram for vpr::SocketBasicOpt:

Collaboration graph
[legend]
List of all members.

Public Methods

vpr::ReturnStatus getKeepAlive (bool &enabled)
vpr::ReturnStatus setKeepAlive (const bool enable_val)
vpr::ReturnStatus getLingerOnClose (bool &enabled, int &linger_sec)
vpr::ReturnStatus setLingerOnClose (const bool enable_val, const int linger_sec)
vpr::ReturnStatus getRecvBufferSize (Int32 &size)
vpr::ReturnStatus setRecvBufferSize (const Int32 size)
vpr::ReturnStatus getSendBufferSize (int &size)
vpr::ReturnStatus setSendBufferSize (const Int32 size)
vpr::ReturnStatus getReuseAddr (bool &enabled)
vpr::ReturnStatus setReuseAddr (const bool enable_val)
 Enables reuse of the address that will be bound by the socket. More...


Detailed Description

Options common to all types of sockets.

Definition at line 58 of file SocketBasicOpt.h.


Member Function Documentation

vpr::ReturnStatus vpr::SocketBasicOpt::getKeepAlive bool &    enabled [inline]
 

Definition at line 64 of file SocketBasicOpt.h.

References vpr::SocketOptions::Data::keep_alive, and vpr::ReturnStatus::success.

00065    {
00066       vpr::SocketOptions::Data option;
00067       vpr::ReturnStatus retval;
00068 
00069       retval = getOption(vpr::SocketOptions::KeepAlive, option);
00070 
00071       if ( retval.success() )
00072       {
00073          enabled = option.keep_alive;
00074       }
00075 
00076       return retval;
00077    }

vpr::ReturnStatus vpr::SocketBasicOpt::setKeepAlive const bool    enable_val [inline]
 

Definition at line 82 of file SocketBasicOpt.h.

References vpr::SocketOptions::Data::keep_alive.

00083    {
00084       vpr::SocketOptions::Data option;
00085       option.keep_alive = enable_val;
00086       return setOption(vpr::SocketOptions::KeepAlive, option);
00087    }

vpr::ReturnStatus vpr::SocketBasicOpt::getLingerOnClose bool &    enabled,
int &    linger_sec
[inline]
 

Definition at line 92 of file SocketBasicOpt.h.

References vpr::SocketOptions::Data::linger, and vpr::ReturnStatus::success.

00093    {
00094       vpr::SocketOptions::Data opt;
00095       vpr::ReturnStatus retval;
00096 
00097       retval = getOption(vpr::SocketOptions::Linger, opt);
00098 
00099       if ( retval.success() )
00100       {
00101          enabled    = opt.linger.enabled;
00102          linger_sec = opt.linger.seconds;
00103       }
00104 
00105       return retval;
00106    }

vpr::ReturnStatus vpr::SocketBasicOpt::setLingerOnClose const bool    enable_val,
const int    linger_sec
[inline]
 

Definition at line 111 of file SocketBasicOpt.h.

References vpr::SocketOptions::Data::linger.

00113    {
00114       vpr::SocketOptions::Data opt;
00115 
00116       opt.linger.enabled = enable_val;
00117       opt.linger.seconds = linger_sec;
00118 
00119       return setOption(vpr::SocketOptions::Linger, opt);
00120    }

vpr::ReturnStatus vpr::SocketBasicOpt::getRecvBufferSize Int32   size [inline]
 

Definition at line 125 of file SocketBasicOpt.h.

References vpr::Int32, vpr::SocketOptions::Data::recv_buffer_size, and vpr::ReturnStatus::success.

00126    {
00127       vpr::SocketOptions::Data opt;
00128       vpr::ReturnStatus retval;
00129 
00130       retval = getOption(vpr::SocketOptions::RecvBufferSize, opt);
00131 
00132       if ( retval.success() )
00133       {
00134          size = opt.recv_buffer_size;
00135       }
00136       else
00137       {
00138          size = -1;
00139       }
00140 
00141       return retval;
00142    }

vpr::ReturnStatus vpr::SocketBasicOpt::setRecvBufferSize const Int32    size [inline]
 

Definition at line 147 of file SocketBasicOpt.h.

References vpr::Int32, and vpr::SocketOptions::Data::recv_buffer_size.

00148    {
00149       vpr::SocketOptions::Data opt;
00150 
00151       opt.recv_buffer_size = size;
00152 
00153       return setOption(vpr::SocketOptions::RecvBufferSize, opt);
00154    }

vpr::ReturnStatus vpr::SocketBasicOpt::getSendBufferSize int &    size [inline]
 

Definition at line 159 of file SocketBasicOpt.h.

References vpr::SocketOptions::Data::send_buffer_size, and vpr::ReturnStatus::success.

00160    {
00161       vpr::SocketOptions::Data opt;
00162       vpr::ReturnStatus retval;
00163 
00164       retval = getOption(vpr::SocketOptions::SendBufferSize, opt);
00165 
00166       if ( retval.success() )
00167       {
00168          size = opt.send_buffer_size;
00169       }
00170       else
00171       {
00172          size = -1;
00173       }
00174 
00175       return retval;
00176    }

vpr::ReturnStatus vpr::SocketBasicOpt::setSendBufferSize const Int32    size [inline]
 

Definition at line 181 of file SocketBasicOpt.h.

References vpr::Int32, and vpr::SocketOptions::Data::send_buffer_size.

00182    {
00183       vpr::SocketOptions::Data opt;
00184 
00185       opt.send_buffer_size = size;
00186 
00187       return setOption(vpr::SocketOptions::SendBufferSize, opt);
00188    }

vpr::ReturnStatus vpr::SocketBasicOpt::getReuseAddr bool &    enabled [inline]
 

Definition at line 193 of file SocketBasicOpt.h.

References vpr::SocketOptions::Data::reuse_addr, and vpr::ReturnStatus::success.

00194    {
00195       vpr::SocketOptions::Data option;
00196       vpr::ReturnStatus retval;
00197 
00198       retval = getOption(vpr::SocketOptions::ReuseAddr, option);
00199 
00200       if ( retval.success() )
00201       {
00202          enabled = option.reuse_addr;
00203       }
00204 
00205       return retval;
00206    }

vpr::ReturnStatus vpr::SocketBasicOpt::setReuseAddr const bool    enable_val [inline]
 

Enables reuse of the address that will be bound by the socket.

Precondition:
The socket has been opened, but bind() has not been called.

Definition at line 213 of file SocketBasicOpt.h.

References vpr::SocketOptions::Data::reuse_addr.

Referenced by vpr::SocketAcceptor::open, and vpr::SocketStream_t< SocketConfiguration >::openServer.

00214    {
00215       vpr::SocketOptions::Data option;
00216       option.reuse_addr = enable_val;
00217       return setOption(vpr::SocketOptions::ReuseAddr, option);
00218    }


The documentation for this class was generated from the following file:
Generated on Sun May 2 14:46:54 2004 for VR Juggler Portable Runtime by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002