00001
00002
00003
00004
00005
00006 #pragma once
00007
00008 #include "../base/Setup.h"
00009
00010 #ifdef MPMA_COMPILE_NET
00011
00012 #include <string>
00013 #include "../base/Types.h"
00014
00015
00016
00017 #if defined(_WIN32) || defined(_WIN64) // msvc
00018
00019 #include <Winsock2.h>
00020 #undef SetPort //wow
00021
00022 typedef int socklen_t;
00023
00024 #elif defined(linux) // g++ linux
00025
00026 #include <sys/socket.h>
00027 #include <arpa/inet.h>
00028 #include <netdb.h>
00029 #include <netinet/tcp.h>
00030
00031 #else // ?
00032
00033 #error Unknown platform in PlatformSockets.h
00034
00035 #endif
00036
00037
00038
00039 namespace NET_INTERNAL
00040 {
00041
00042 bool Internal_SetSocketBlocking(nsint sock, bool block);
00043
00044
00045 void Internal_ClearLastError();
00046
00047
00048 std::string Internal_GetLastError();
00049
00050
00051 void Internal_CloseSocket(nsint sock);
00052
00053
00054 bool Internal_IsLastSocketErrorADisconnect();
00055
00056
00057 bool Internal_GetSubnet(uint32 &mask, uint32 &net, uint32 &localIp);
00058 }
00059
00060 #endif //#ifdef MPMA_COMPILE_NET