#include "stdafx.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

CWinApp theApp;
using namespace std;

#include "afxsock.h"
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
	if(AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0) && AfxSocketInit())
	{
		char* dados = {"Ola mundo!!!"};	// Dados para serem enviados

		CSocket UDP;					// Cria objeto para troca de pacotes
		UDP.Create(0,SOCK_DGRAM);		// Inicializa objeto UDP
		UDP.SendTo(dados,strlen(dados),4900,"127.0.0.1");	//Envia os dados (4900 é a porta e "127.0.0.1" é o IP);
		UDP.Close();				// Encerra objeto UDP
	}
	return 0;
}



