#ifndef _SOCKET_H_
#define _SOCKET_H_
#include "const.h"
#include "libsocket.h"

class Socket{
	public:
		Socket(const char * ip, int port){ ::connectServer(ip, port);}
		int nextInt(){ return ::nextInt();} 
		float nextFloat(){return ::nextFloat();}
		void writeInt(int value){::writeInt(value);} 
		void writeFloat(float value){::writeFloat(value);}
		void flush(){::flush();}
		void lock(){ ::lockMutex();}
		void unlock(){ ::unlockMutex();}
		~Socket(){closeSocket();}
};
#endif /* _SOCKET_H_ */
