00001 // 00002 // DISCLAIMER: 00003 // This software was produced by the National Institute of Standards 00004 // and Technology (NIST), an agency of the U.S. government, and by statute is 00005 // not subject to copyright in the United States. Recipients of this 00006 // software assume all responsibility associated with its operation, 00007 // modification,maintenance, and subsequent redistribution. 00008 // 00009 // See NIST Administration Manual 4.09.07 b and Appendix I. 00010 // 00011 // Socket class header file 00012 // 00013 // this file is responsible to impor the system win sock header file 00014 // and sort out the compatibility issues. 00015 // 00016 #pragma once 00017 00018 00019 #ifdef _MSC_VER 00020 // ---------------------------------- Microsoft Compiler/Windows specific headers 00021 #if _MSC_VER <= 1200 00022 // we want this set of header for visual Studio 6 with no platform SDK included 00023 00024 #define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */ 00025 00026 #ifdef WINVER 00027 #undef WINVER 00028 #define WINVER 0x0400 00029 #endif 00030 00031 #include <windows.h> 00032 #include <winsock2.h> 00033 #pragma message("including winsock.h") 00034 #else 00035 // we what this set of header for VC++.NET 2003 and above 00036 #pragma message("including winsock2.h") 00037 #include <winsock2.h> 00038 #endif 00039 00040 #else 00041 00043 //#include <sys/socket.h> 00044 //#include "cygwin/in.h" 00045 //typedef struct sockaddr_in SOCKADDR_IN; 00046 //typedef struct hostent* LPHOSTENT; 00047 //typedef u_int SOCKET; 00048 // 00049 //#ifndef WSAEWOULDBLOCK 00050 //#define WSAEWOULDBLOCK 10035L 00051 //#endif 00052 // 00053 //#ifndef WSAEISCONN 00054 //#define WSAEISCONN 10056L 00055 //#endif 00056 00057 #endif