00001 /****************** <VPR heading BEGIN do not edit this line> ***************** 00002 * 00003 * VR Juggler Portable Runtime 00004 * 00005 * Original Authors: 00006 * Allen Bierbaum, Patrick Hartling, Kevin Meinert, Carolina Cruz-Neira 00007 * 00008 * ----------------------------------------------------------------- 00009 * File: $RCSfile$ 00010 * Date modified: $Date: 2005-05-16 15:13:18 -0500 (Mon, 16 May 2005) $ 00011 * Version: $Revision: 17502 $ 00012 * ----------------------------------------------------------------- 00013 * 00014 ****************** <VPR heading END do not edit this line> ******************/ 00015 00016 /*************** <auto-copyright.pl BEGIN do not edit this line> ************** 00017 * 00018 * VR Juggler is (C) Copyright 1998-2005 by Iowa State University 00019 * 00020 * Original Authors: 00021 * Allen Bierbaum, Christopher Just, 00022 * Patrick Hartling, Kevin Meinert, 00023 * Carolina Cruz-Neira, Albert Baker 00024 * 00025 * This library is free software; you can redistribute it and/or 00026 * modify it under the terms of the GNU Library General Public 00027 * License as published by the Free Software Foundation; either 00028 * version 2 of the License, or (at your option) any later version. 00029 * 00030 * This library is distributed in the hope that it will be useful, 00031 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00032 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00033 * Library General Public License for more details. 00034 * 00035 * You should have received a copy of the GNU Library General Public 00036 * License along with this library; if not, write to the 00037 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00038 * Boston, MA 02111-1307, USA. 00039 * 00040 *************** <auto-copyright.pl END do not edit this line> ***************/ 00041 00042 #ifndef _VPR_SOCKET_STREAM_OPT_H_ 00043 #define _VPR_SOCKET_STREAM_OPT_H_ 00044 00045 #include <vpr/vprConfig.h> 00046 00047 #include <vpr/vprTypes.h> 00048 #include <vpr/IO/Socket/SocketOptions.h> 00049 #include <vpr/IO/Socket/SocketIpOpt.h> 00050 #include <vpr/Util/ReturnStatus.h> 00051 00052 00053 namespace vpr 00054 { 00055 00060 class VPR_CLASS_API SocketStreamOpt : public vpr::SocketOptionWrapper 00061 { 00062 public: 00067 SocketStreamOpt(); 00068 00073 virtual ~SocketStreamOpt(); 00074 00078 vpr::ReturnStatus getMaxSegmentSize(size_t& size) 00079 { 00080 vpr::SocketOptions::Data option; 00081 vpr::ReturnStatus retval; 00082 00083 retval = getOption(vpr::SocketOptions::MaxSegment, option); 00084 00085 if ( retval.success() ) 00086 { 00087 size = option.max_segment; 00088 } 00089 00090 return retval; 00091 } 00092 00096 vpr::ReturnStatus setMaxSegmentSize(const vpr::Int32 size) 00097 { 00098 vpr::SocketOptions::Data option; 00099 option.max_segment = size; 00100 return setOption(vpr::SocketOptions::MaxSegment, option); 00101 } 00102 00114 vpr::ReturnStatus getNoDelay(bool& enabled) 00115 { 00116 vpr::SocketOptions::Data option; 00117 vpr::ReturnStatus retval; 00118 00119 retval = getOption(vpr::SocketOptions::NoDelay, option); 00120 00121 if ( retval.success() ) 00122 { 00123 enabled = option.no_delay; 00124 } 00125 00126 return retval; 00127 } 00128 00136 vpr::ReturnStatus setNoDelay(const bool enableVal) 00137 { 00138 vpr::SocketOptions::Data option; 00139 option.no_delay = enableVal; 00140 return setOption(vpr::SocketOptions::NoDelay, option); 00141 } 00142 }; 00143 00144 } // End of vpr namespace 00145 00146 00147 #endif /* _VPR_SOCKET_STREAM_OPT_H_ */
1.5.1