mirror of
https://github.com/glest/glest-source.git
synced 2025-09-29 00:48:58 +02:00
Updated with initial 3.4.4 codebase includes:
- network fixes for multiplayer defects found - initial code (disabled currently) for content crc checking and downloading - code compiles on Win32 using VS2008 express, project files not yet included
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2005 Matthias Braun <matze@braunis.de>
|
||||
//
|
||||
// You can redistribute this code and/or modify it under
|
||||
// the terms of the GNU General Public License as published
|
||||
// by the Free Software Foundation; either version 2 of the
|
||||
// You can redistribute this code and/or modify it under
|
||||
// the terms of the GNU General Public License as published
|
||||
// by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version
|
||||
// ==============================================================
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <fcntl.h>
|
||||
#include <map>
|
||||
|
||||
using std::string;
|
||||
|
||||
@@ -51,20 +52,30 @@ public:
|
||||
class Socket {
|
||||
protected:
|
||||
int sock;
|
||||
|
||||
|
||||
public:
|
||||
Socket(int sock);
|
||||
Socket();
|
||||
~Socket();
|
||||
|
||||
static bool enableDebugText;
|
||||
|
||||
// Int lookup is socket fd while bool result is whether or not that socket was signalled for reading
|
||||
static bool hasDataToRead(std::map<int,bool> &socketTriggeredList);
|
||||
static bool hasDataToRead(int socket);
|
||||
bool hasDataToRead();
|
||||
void disconnectSocket();
|
||||
|
||||
int getSocketId() const { return sock; }
|
||||
|
||||
int getDataToRead();
|
||||
int send(const void *data, int dataSize);
|
||||
int receive(void *data, int dataSize);
|
||||
int peek(void *data, int dataSize);
|
||||
|
||||
|
||||
void setBlock(bool block);
|
||||
bool isReadable();
|
||||
bool isWritable();
|
||||
bool isWritable(bool waitOnDelayedResponse);
|
||||
bool isConnected();
|
||||
|
||||
string getHostName() const;
|
||||
|
Reference in New Issue
Block a user