Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

SockOp.hh

Go to the documentation of this file.
00001 /*
00002 
00003     Socket I/O operations
00004     Copyright (C) 1999-2002 Jussi Laako
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 */
00021 
00022 
00023 #include <sys/types.h>
00024 #include <sys/socket.h>
00025 #include <netinet/ip.h>
00026 
00027 
00028 #ifndef SOCKOP_HH
00029     #define SOCKOP_HH
00030 
00031     #if (defined(__QNX__) && !defined(socklen_t))
00032     typedef size_t socklen_t;
00033     #endif
00034 
00035 
00039     class clSockOp
00040     {
00041             int iErrno;
00042             int iRetVal;
00043             int iSockH;
00044             bool bCloseOnDestruct;
00045         public:
00046             clSockOp ();
00047             clSockOp (int);
00048             ~clSockOp ();
00056             void SetHandle (int);
00060             void Close ();
00067             bool ReadSelect (int);
00074             bool WriteSelect (int);
00082             int Read (void *, int);
00090             int Write (const void *, int);
00100             int ReadN (void *, int);
00110             int WriteN (const void *, int);
00119             int Receive (void *, int, int);
00128             int Send (const void *, int, int);
00136             int ReceiveMsg (struct msghdr *, int);
00144             int SendMsg (const struct msghdr *, int);
00151             int Shutdown (int);
00159             int GetSockName (struct sockaddr *, socklen_t *);
00167             int GetPeerName (struct sockaddr *, socklen_t *);
00174             bool SetBlocking (bool);
00180             bool SetKeepAlive ();
00187             bool SetLinger (int);
00193             int GetRecvBufSize ();
00200             bool SetRecvBufSize (int);
00206             int GetSendBufSize ();
00213             bool SetSendBufSize (int);
00219             int GetRecvBufLowWater ();
00226             bool SetRecvBufLowWater (int);
00232             int GetSendBufLowWater ();
00239             bool SetSendBufLowWater (int);
00246             bool SetRecvTimeout (int);
00253             bool SetSendTimeout (int);
00260             bool SetTCPKeepAlive (int);
00266             bool DisableNagle ();
00268             bool SetNagle (bool);
00275             bool SetTypeOfService (int);
00281             void SetCloseOnDestruct (bool);
00287             int GetHandle () { return iSockH; }
00293             int GetErrno () { return iErrno; }
00294     };
00295 
00296 #endif

Generated on Sun Oct 26 19:11:22 2003 for HASAS by doxygen 1.3.3