/* YUNTAI KYONG
Advanced Internet Service
term project
*/
#ifndef _SOCKET_H_
#define _SOCKET_H_

#include <winsock2.h>

class CSocket
{
	SOCKET m_sock;
	enum socket_type { SOCK_UDP };
public:
	CSocket() {};
	CSocket(SOCKET socket):m_sock(socket){};
	
	bool startup();
	bool open(struct sockaddr *name, int namelen, int port);
	bool listen(unsigned short port);
	int read(void *buffer, int nbytes);
	int write(void *buffer, int nbytes);
	bool close();
};
#endif	/* _SOCKET_H_ */

