About Store Forum Documentation Contact
Donations:
345$/mo



Post Reply 
Problems with the NET
Author Message
Babulesnik Offline
Member

Post: #1
Problems with the NET
Please help me with a problem. Messages reach the other computers or come to me, but instead of "Hi world!!!" I get "??????????"

Even after closing the my program, VisualStudio writers -"Windows has triggered a breakpoint in tuturials.exe"

/******************************************************************************/
#include "stdafx.h"
#include "resource.h"

#define BASE_PORT 10000

Str options_ip,incoming_text,
send_text ="Hi World !!!";
FileText File_options;
Int rcv;

SockAddr my_adress,serv_adress;
Socket sock ;
/******************************************************************************/
void InitPre()
{
App.name("NET");
App.icon=(Char*)IDI_ICON1;
App.flag=APP_NO_FX;
Paks.add("../data/engine.pak");
D.sync(true);
}
/******************************************************************************/
Bool Init()
{
{
FREP(50)
{
sock.createUdp();
if(sock.bind(SockAddr().setServer(BASE_PORT+i)))break;
}

sock.block(false);
}
if( File_options.read("../Data/options.txt") ){ options_ip=File_options.fullLine();}
my_adress.port(10000);
my_adress.ip("127.0.0.1");

serv_adress.port(10000);
serv_adress.ip(options_ip);
return true;
}
/******************************************************************************/
void Shut()
{

}
/******************************************************************************/
Bool Update()
{
if(Kb.bp(KB_ENTER))sock.send(serv_adress,&send_text,SIZE(send_text));

sock.receive(my_adress,&incoming_text,SIZE(incoming_text));

if(Kb.bp(KB_ESC))return false;
return true;
}
/******************************************************************************/
void Draw()
{

D.clear(TURQ);
D.text (0, 0.1f,S+incoming_text);
}
/******************************************************************************/

Help please understand
(This post was last modified: 02-19-2011 12:44 AM by Babulesnik.)
02-19-2011 12:42 AM
Find all posts by this user Quote this message in a reply
Post Reply