program Test_UDP_Client;

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 p;
	int d=666;
begin
	full_screen=false;
 	net_init();
	net_udp_allocpacket(0,4);
	net_udp_open(0,0);
 	net_udp_bind(0,1,"127.0.0.1",16660);
	p=net_udp_getpacket(0);
 	p.len=4;
 	memcopy(p.data,&d,4);
 	net_udp_send(0,1,0);
 	net_udp_unbind(0,1);
	net_udp_close(0);
	net_udp_freepacket(0);
 	net_quit();
end
