(file) Return to Socket.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

 1 karl  1.9 //%2003////////////////////////////////////////////////////////////////////////
 2 mike  1.2 //
 3 karl  1.9 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development
 4           // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
 5           // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
 6           // IBM Corp.; EMC Corporation, The Open Group.
 7 mike  1.2 //
 8           // Permission is hereby granted, free of charge, to any person obtaining a copy
 9 kumpf 1.4 // of this software and associated documentation files (the "Software"), to
10           // deal in the Software without restriction, including without limitation the
11           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 mike  1.2 // sell copies of the Software, and to permit persons to whom the Software is
13           // furnished to do so, subject to the following conditions:
14           // 
15 kumpf 1.4 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
16 mike  1.2 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
17           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
18 kumpf 1.4 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 mike  1.2 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23           //
24           //==============================================================================
25           //
26           // Author: Mike Brasher (mbrasher@bmc.com)
27           //
28           // Modified By:
29           //
30           //%/////////////////////////////////////////////////////////////////////////////
31           
32           #ifndef Pegasus_Socket_h
33           #define Pegasus_Socket_h
34           
35           #include <Pegasus/Common/Config.h>
36 mday  1.6 #include <Pegasus/Common/IPC.h>
37           #ifdef PEGASUS_OS_TYPE_WINDOWS
38           #include <windows.h>
39           # ifndef _WINSOCKAPI_
40           #   include <winsock2.h>
41           # endif
42           #else
43           # include <cctype>
44           #ifndef PEGASUS_OS_OS400
45 mday  1.7 //#   include <unistd.h>
46 mday  1.6 #else
47           #   include <Pegasus/Common/OS400ConvertChar.h>
48           #   include <unistd.cleinc>
49           #endif
50           #ifdef PEGASUS_OS_ZOS
51           #   include <string.h>  // added by rk for memcpy
52           #endif
53           # include <cstdlib>
54           # include <errno.h>
55           # include <fcntl.h>
56           # include <netdb.h>
57           # include <netinet/in.h>
58           # include <arpa/inet.h>
59           # include <sys/socket.h>
60           #endif
61 kumpf 1.5 #include <Pegasus/Common/Linkage.h>
62 marek 1.8 #ifdef PEGASUS_OS_ZOS
63           #   include <Pegasus/Common/SocketzOS_inline.h>
64           #endif
65 mike  1.2 
66           PEGASUS_NAMESPACE_BEGIN
67           
68 kumpf 1.3 class PEGASUS_COMMON_LINKAGE Socket
69 mike  1.2 {
70 mday  1.6    public:
71 mike  1.2 
72           
73 mday  1.6       static Sint32 read(Sint32 socket, void* ptr, Uint32 size);
74 mike  1.2 
75 mday  1.6       static Sint32 write(Sint32 socket, const void* ptr, Uint32 size);
76 mike  1.2 
77 mday  1.6       static void close(Sint32 socket);
78                 static int close2(Sint32 socket);
79                 
80                 static void enableBlocking(Sint32 socket);
81                 static int  enableBlocking2(Sint32 socket);
82 mike  1.2 
83 mday  1.6       static void disableBlocking(Sint32 socket);
84                 static int disableBlocking2(Sint32 socket);
85 mike  1.2 
86 mday  1.6       static void initializeInterface(void);
87                 static void uninitializeInterface(void);
88                 
89 mike  1.2 
90 mday  1.6    private:
91 mike  1.2 
92 mday  1.6       Socket() { }
93           };
94 mike  1.2 
95           
96           
97           PEGASUS_NAMESPACE_END
98           
99           #endif /* Pegasus_Socket_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2