00001
00010 #ifndef __NETLISTENER_H__
00011 #define __NETLISTENER_H__
00012
00013 #include <windows.h>
00014 #include <winsock.h>
00015
00016 #define DEFAULT_PORT 8188
00017
00018 class NetListener
00019 {
00020 private:
00021 char server_name[64];
00022 unsigned short port;
00023
00024 WSADATA wsaData;
00025 SOCKET udp_socket;
00026
00027 public:
00028 NetListener(int port = DEFAULT_PORT);
00029 ~NetListener();
00030
00031 bool init();
00032 void cleanup();
00033
00034 int listenerConnect(unsigned long blocking);
00035 bool listenerClose();
00036
00037 bool listenerReceive(char* data,unsigned int bufferSize);
00038 };
00039
00040 #endif