// UDPSocket.h: interface for the UDPSocket class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_UDPSOCKET_H__47112B7A_B565_11D3_934F_0060674E1056__INCLUDED_)
#define AFX_UDPSOCKET_H__47112B7A_B565_11D3_934F_0060674E1056__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include<iostream>
#include<string>
#include"Blocksock.h"

static const int tempBufSize = 8192;

class UDPSocket : public CBlockingSocket {
	CSockAddr server;
	char tempBuf[tempBufSize]; //temporary storage for the messages we receive
public:
	UDPSocket();
	int init(const string & host, int port);
	int sendMessage(const string & buf);
//	int receiveMessage(string & buf);
	int receiveMessageBlock(string & buf);
	void closeConnection() {Close();};
};


#endif // !defined(AFX_UDPSOCKET_H__47112B7A_B565_11D3_934F_0060674E1056__INCLUDED_)