Skip to content

Commit

Permalink
On win32 load the socket subsystem.
Browse files Browse the repository at this point in the history
  • Loading branch information
xkbeyer committed Nov 21, 2017
1 parent 356bf84 commit 2075ca8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/fts-net.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
#include <string>
#include "fts-net.h"
#include "Logger.h"
#if defined(_WIN32)
# pragma comment(lib, "Ws2_32.lib")
# include<winsock2.h>
#endif

bool FTS::NetworkLibInit( int dbgLevel, std::ostream * out )
{
Logger::DbgLevel( dbgLevel );
Logger::LogFile(out);

#if defined(_WIN32)
// And the windows sockets.
WSADATA wsaData;
if(WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
FTSMSGDBG("Winsock version {1}.{2} initialized ", 2, std::to_string(LOBYTE(wsaData.wVersion)), std::to_string(HIBYTE(wsaData.wVersion)));
#endif

return true;
}

0 comments on commit 2075ca8

Please sign in to comment.