|
|
|
|
|
|
|
|
|
|
|
|
|
|
using namespace std; |
|
|
using namespace std; |
|
|
|
|
|
|
|
|
|
|
|
#include <cstdlib> |
|
|
|
|
|
#include <cstdio> |
|
|
|
|
|
#include <cerrno> |
|
|
|
|
|
|
|
|
//// Platform specific includes... |
|
|
//// Platform specific includes... |
|
|
|
|
|
|
|
|
#if defined(WIN32) || defined(WIN64) |
|
|
#if defined(WIN32) || defined(WIN64) |
|
|
|
|
|
|
|
|
#include <arpa/inet.h> |
|
|
#include <arpa/inet.h> |
|
|
#include <unistd.h> |
|
|
#include <unistd.h> |
|
|
#include <fcntl.h> |
|
|
#include <fcntl.h> |
|
|
#include <cstdlib> |
|
|
|
|
|
#include <cstdio> |
|
|
|
|
|
#include <cerrno> |
|
|
|
|
|
|
|
|
|
|
|
typedef int hSocket; // *nix uses int to handle a Socket. |
|
|
typedef int hSocket; // *nix uses int to handle a Socket. |
|
|
const hSocket INVALID_SOCKET = -1; // -1 is the invalid Socket. |
|
|
const hSocket INVALID_SOCKET = -1; // -1 is the invalid Socket. |