mirror of
https://github.com/libretro/Mesen.git
synced 2024-11-24 01:29:41 +00:00
48409ae82b
-Several other fixes (bugfixes, refactoring, etc.) -Added a few more features to debugger
37 lines
742 B
C++
37 lines
742 B
C++
#pragma once
|
|
#include "stdafx.h"
|
|
#include "../Utilities/SimpleLock.h"
|
|
|
|
class Socket;
|
|
class NetMessage;
|
|
class ClientConnectionData;
|
|
|
|
class GameConnection
|
|
{
|
|
protected:
|
|
shared_ptr<Socket> _socket;
|
|
shared_ptr<ClientConnectionData> _connectionData;
|
|
char _readBuffer[0x40000];
|
|
char _messageBuffer[0x40000];
|
|
int _readPosition = 0;
|
|
SimpleLock _socketLock;
|
|
|
|
private:
|
|
void ReadSocket();
|
|
|
|
bool ExtractMessage(char *buffer, uint32_t &messageLength);
|
|
NetMessage* ReadMessage();
|
|
|
|
virtual void ProcessMessage(NetMessage* message) = 0;
|
|
|
|
protected:
|
|
void SendNetMessage(NetMessage &message);
|
|
|
|
public:
|
|
GameConnection(shared_ptr<Socket> socket, shared_ptr<ClientConnectionData> connectionData);
|
|
|
|
bool ConnectionError();
|
|
|
|
void ProcessMessages();
|
|
|
|
}; |