Re: now, easily use bgt's network feature
Congratulations on creating this class, it will really make it much easier to use the network in bgt! Very good.
I'm doing some experiments here, would you or anyone could help me with these two codes? They are very simple:
Here is the client code:
#include "net.bgt"
net n;
void main(){
n.connect("127.0.0.1",35535);
n.create_client(1,1);
while (true){
wait(10);
n.request();
show_game_window ("Test client");
if(n.is_disconnected()) alert ("ERROR","Not connected");
}
wait (10);
}
And this is the server code:
#include"net.bgt"
net n;
void main(){
n.set_port(35535);
if(n.create_server(1,1)) alert("ok","sercer created");
while(true){
show_game_window("Test server");
n.request();
if(n.is_connected()) alert("uau","Client is connected to the server")
;
}
wait (10);
}
As you can tell, in the server code, an alert would have to appear when a client connects to it. However, only the alert appears that the server is connected.
In the client, at least here, an alert should appear when it can not connect to the server, but this is not happening, even with the server inactive.
I'm doing the tests on my local machine myself and the first time the windows firewall appeared and I allowed
access.
What am I doing wrong?
Thank you!
_______________________________________________ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector