Zhanghua
Member
Server Create
Server Step
Server Asyn event
When the network_type_connect Type is triggered, the async_load give me the server's port and ip, while not the client's information???
BUG? or has other method to conqure this barrier.
My Server and Client is in the same room. Just a test.
Client Create
Client Asyn
why this function new another port 6153 which is the server listen port to send data? while not the orignal port?
Or my router change the port? althrough in the same level LAN?
And all the object share the same asyn event and buffer? Because I found that the server obj send the data to the client obj, the server and client are triggered the "network_type_data" at the same time.
Although I just send message from the server obj....... That's so weired....
PS: In the Udp mode, another bug is here:
network_send_broadcast(server,dstport,sendbuff, buffer_get_size(sendbuff));
Code:
srcport = 6513;
server = network_create_server(network_socket_tcp,srcport,5);
network_set_timeout(server,2000,2000);
ClientMap = ds_map_create();
Code:
var sendbuff = buffer_create(16384, buffer_fixed, 2);
var size = ds_map_size(ClientMap) ;
if( size > 0 ){
var sock = ds_map_find_first(ClientMap);
for (var i = 0; i < size; i++;){
network_send_packet(sock,sendbuff,buffer_get_size(sendbuff));
sock = ds_map_find_next(ClientMap, sock);
}
}
buffer_delete(sendbuff);
Code:
var type = async_load[? "type"];
//debug_show_map(async_load);
switch( type ){
case network_type_connect:
var sock = async_load[? "socket"];
ClientMap[? sock] = 1;
show_debug_message(async_load[? "port"]);
break;
case network_type_disconnect:
var sock = async_load[? "socket"];
ds_map_delete(ClientMap,async_load[? sock]);
break;
}
BUG? or has other method to conqure this barrier.
My Server and Client is in the same room. Just a test.
Client Create
Code:
dstport = 6513;
client = network_create_socket(network_socket_tcp);
network_set_timeout(client,2000,2000);
network_connect(client,"192.168.2.104",dstport);
Code:
var type = async_load[? "type"];
if( network_type_data == type ){
show_debug_message("client!!!!!!!");
debug_show_map(async_load);
}
Code:
TCP 0.0.0.0:6513 0.0.0.0:0 LISTENING 4044
TCP 192.168.2.104:6513 192.168.2.104:52893 ESTABLISHED 4044
TCP 192.168.2.104:52893 192.168.2.104:6513 ESTABLISHED 1792
Or my router change the port? althrough in the same level LAN?
And all the object share the same asyn event and buffer? Because I found that the server obj send the data to the client obj, the server and client are triggered the "network_type_data" at the same time.
Although I just send message from the server obj....... That's so weired....
PS: In the Udp mode, another bug is here:
network_send_broadcast(server,dstport,sendbuff, buffer_get_size(sendbuff));
Last edited: