Fixed PSP compilation by stubbing the socket implementation. Somebody with a PSP, please replace this code with a real implementation.

This commit is contained in:
Xawotihs@gmail.com
2013-02-03 21:41:31 +00:00
parent 5c25189aef
commit 5a9b7eefc0
5 changed files with 35 additions and 24 deletions

View File

@@ -5,6 +5,8 @@
#include "Threading.h"
using namespace std;
#define SERVER_PORT 5001
class JSocket{
public:
typedef enum {
@@ -19,10 +21,11 @@ public:
} SOCKET_STATE;
// Server creation
JSocket(string ipAddr);
// Client creation
JSocket(string ipAddr);
// Server creation
JSocket();
~JSocket();
JSocket* Accept();
@@ -41,7 +44,7 @@ private:
// socket handle
#ifdef WIN32
SOCKET mfd;
#elif LINUX
#elif LINUX || PSP
int mfd;
#endif
};

View File

@@ -188,11 +188,7 @@ void JNetwork::ThreadProc(void* param)
pThis->toSend.str("");
}
}
#ifdef LINUX
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
#elif WIN32
// boost::this_thread::sleep(boost::posix_time::microseconds(10));
#endif
}
DebugTrace("Quitting Thread");
@@ -209,7 +205,7 @@ int JNetwork::connect(const string& ip)
#else
int JNetwork::connect(string serverIP){
int JNetwork::connect(const string& serverIP){
#ifdef NETWORK_SUPPORT
int err;
char buffer[4096];

View File

@@ -1,4 +1,3 @@
#if 0
// need a complete rewrite to comply to the new interface
#ifdef NETWORK_SUPPORT
@@ -21,23 +20,21 @@
#endif
#include "../include/JGE.h"
#include "../include/JSocket.h"
JSocket * JSocket::mInstance = NULL;
#define SERVER_PORT 20666
int JSocket::connected = 0;
void JSocket::init(){
JSocket::JSocket(){
#ifdef NETWORK_SUPPORT
sceUtilityLoadNetModule(1);
sceUtilityLoadNetModule(3);
#endif
}
JSocket::JSocket(){
init();
JSocket::JSocket(string ipAddr)
{
}
JSocket::JSocket(int fd)
{
}
JSocket::~JSocket(){
@@ -48,7 +45,27 @@ JSocket::~JSocket(){
#endif
}
void JSocket::Disconnect()
{
}
JSocket* JSocket::Accept()
{
return 0;
}
int JSocket::Read(char* buff, int size)
{
return 0;
}
int JSocket::Write(char* buff, int size)
{
return 0;
}
#if 0
int JSocket::make_socket(uint16_t port)
{
int sock = -1;

View File

@@ -16,11 +16,6 @@
#include "../../include/JSocket.h"
#include "../../include/DebugRoutines.h"
//JSocket * JSocket::mInstance = NULL;
//#define SERVER_PORT 20666
#define SERVER_PORT 5001
unsigned char ADRESSE_IP_SERVEUR [4] = {127,0,0,1};
JSocket::JSocket(string ipAddr)

View File

@@ -51,8 +51,8 @@ GameState::GameState(GameApp* parent, string id) :
GameApp::GameApp() :
JApp()
#ifdef NETWORK_SUPPORT
,mpNetwork(NULL)
, mServerAddress("")
, mpNetwork(NULL)
#endif //NETWORK_SUPPORT
{
#ifdef DEBUG