/*! * @file network_socket.h * Main interface for the network module. Manages all the modules */ #ifndef _NETWORK_SOCKET #define _NETWORK_SOCKET /* include this file, it contains some default definitions */ #include "netdefs.h" /* include SDL_net header */ #include "SDL_net.h" /* using namespace std is default, this needs to be here */ using namespace std; class NetworkSocket { private: IPaddress serverAddress; unsigned int port; TCPsocket tcpSocket; UDPsocket udpSocket; public: NetworkSocket(); ~NetworkSocket(); void connectToServer(IPaddress ip, unsigned int port); void listen(unsigned int port); void disconnectServer(); void writeBytes(byte* data); byte* readBytes(); }; #endif /* _NETWORK_SOCKET */