program Test_TCP_ServerSocketSet;
import "net.dll"
PRIVATE
	check;
begin
	full_screen=false;
 	net_init();
 	net_resolvehost(0,0,16660);
 	net_tcp_open(0);
  	write(0,10,10,3,"Server");
  	write_int(0,200,110,3,&check);
  	
  	net_socketset_alloc(0,1);
  	net_socketset_tcp_add(0,0);
  	
  	
  	
  	repeat
  		if(net_socketset_check(0,0))
	  		if(net_socketset_tcp_ready(0))
				if(!net_tcp_accept(0))
					break;
				end
			end
		end
    		frame;
  	until(key(_esc))
  	
  	repeat
  		if(net_tcp_recv(0,&check,4)==4)
  			break;
  		end
  		frame;
  	until(key(_esc))
  	
	repeat	
		frame;
 	until(key(_esc))
 	
 	net_tcp_close(0);
 	net_socketset_free(0);
  	net_quit();
end
