- Crude networking functions:
+ Basic message works on Windows
+ Compiles on PSP but doesn't work yet
+ Nothing done for Linux -> TODO!
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-05-18 11:22:53 +00:00
parent a5b59c2079
commit f32f5f3793
7 changed files with 744 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#ifndef _JSOCKET_H_
#define _JSOCKET_H_
#include <queue>
using namespace std;
//TODO config ?
#define SERVER_PORT 20666
class JSocket{
public:
queue<char> received_data;
queue<char> tosend_data;
static JSocket * mInstance;
int start_server(const char *szIpAddr);
int start_client(const char *szIpAddr);
JSocket();
~JSocket();
static int connected;
private:
void init();
void readWrite(int sock);
#if defined (WIN32) || defined (LINUX)
#else
int make_socket(uint16_t port);
#endif
};
#endif