1 // ***************************************************************************
2 // NetWin_p.h (c) 2011 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // ---------------------------------------------------------------------------
5 // Last modified: 8 December 2011 (DB)
6 // ---------------------------------------------------------------------------
7 // Provides common networking-related includes, etc. for Windows systems
9 // Note: requires Windows XP or later
10 // ***************************************************************************
19 // This file is not part of the BamTools API. It exists purely as an
20 // implementation detail. This header file may change from version to version
21 // without notice, or even be removed.
25 #ifdef _WIN32 // <-- source files only include the proper Net*_p.h, but this is a double-check
27 #include <winsock2.h> // <-- should bring 'windows.h' along with it
31 # define BT_SOCKLEN_T int
35 # pragma comment(lib, "ws2_32.lib")
41 // use RAII to ensure WSA is initialized
42 class WindowsSockInit {
44 WindowsSockInit(void) {
46 WSAStartup(MAKEWORD(2,2), &wsadata); // catch error ?
49 ~WindowsSockInit(void) {
54 } // namespace Internal
55 } // namespace BamTools