program Test_UDP_ClientV;

type _IPaddress
    int host;
    word port;
end

type _UDPpacket
    int channel;       
    byte pointer data;
    int len;
    int maxlen;
    int status;
    _IPaddress address;
end

import "net.dll"
PRIVATE
	_UDPpacket pointer pointer p;
	int d=666;
begin
	full_screen=false;
 	net_init();
	net_udp_allocpacketv(0,3,4);
	net_udp_open(0,0);
 	net_udp_bind(0,1,"127.0.0.1",16660);
	p=net_udp_getpacketv(0);
	
 	p[0].len=4;
 	p[1].len=4;
 	p[2].len=4;
 	p[0].channel=1;
 	p[1].channel=1;
 	p[2].channel=1;
 	memcopy(p[0].data,&d,4);
 	d++;
 	memcopy(p[1].data,&d,4);
 	d++;
 	memcopy(p[2].data,&d,4);

 	net_udp_sendv(0,0,3);
 	net_udp_unbind(0,1);
 	net_udp_freepacketv(0);
	net_udp_close(0);
 	net_quit();
end