rem: while(replies<systems && new Date().valueOf()-begin.valueOf() < UDP_RESPONSE_TIMEOUT) 
add: while(replies<udp_req && new Date().valueOf()-begin.valueOf() < UDP_RESPONSE_TIMEOUT) 
context: function list_users(show){	imsg_user = new Array();	var systems=0;	var replies=0;	users = 0;	start = new Date();	print("\1m\1hListing Systems and Users (Ctrl-C to Abort)...");	/* UDP systems */	sock = new Socket(SOCK_DGRAM);	//sock.debug=true;	sock.bind();	for(i=0;sys[i]!=undefined && !(bbs.sys_status&SS_ABORT);i++) {		if(sys[i].ip==undefined)			continue;		if(!sock.sendto("\r\n",sys[i].ip,79))	// Get list of active users			//printf("FAILED! (%d) Sending to %s\r\n",sock.last_error,sys[i].addr);			continue;		systems++;	}	begin = new Date();	while(replies<systems && new Date().valueOf()-begin.valueOf() < UDP_RESPONSE_TIMEOUT)	{		if(!sock.poll(1))			continue;		message=sock.recvfrom(20000);		if(message==null)			continue;		i=get_sysnum(message.ip_address);		if(i==-1)			continue;		replies++;		sys[i].udp=true;		sys[i].reply=new Date().valueOf()-start.valueOf();		response=message.data.split("\r\n");		if(show) {			console.line_counter=0;	// defeat pause			printf("\1n\1h%-25.25s\1n ",sys[i].addr);		}		parse_response(response, show);	}		sock.close();	/* TCP systems */	for(i=0;sys[i]!=undefined && !(bbs.sys_status&SS_ABORT);i++) {		if(sys[i].udp)			continue;					replies++;		if(sys[i].failed)			continue;		begin = new Date();		if(show) {			console.line_counter=0;	// defeat pause			printf("\1n\1h%-25.25s\1n ",sys[i].addr);		}		sock = new Socket();		is_connected = false;		if(sys[i].ip != undefined) {			is_connected = sock.connect(sys[i].ip,79);			if(!is_connected)				sys[i].ip = undefined;	// IP no good, remove from cache		}		if(!is_connected && !sock.connect(sys[i].addr,79)) {			log(format("!Finger connection to %s FAILED with error %d"				,sys[i].addr,sock.last_error));			alert("system not available");			sys[i].failed = true;			continue;		}		sys[i].reply=new Date().valueOf()-begin.valueOf();		// cache the IP address for faster resolution		if(sys[i].ip != sock.remote_ip_address)			sys[i].ip = sock.remote_ip_address;			sock.send("\r\n");	// Get list of active users		var response=new Array();		while(bbs.online && sock.is_connected) {			str=sock.readline();			if(str==null)				break;			str = truncsp(str);			if(str=="")				continue;			response.push(str);		}		sock.close();		parse_response(response,show);	}			t = new Date().valueOf()-start.valueOf();	printf("\1m\1h%lu systems and %lu users listed in %d seconds.\r\n"		,replies, users, t/1000);	save_sys_list();}
meta: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/05ce5f68ce14b6b7aaa0d062ab98e9c7431c1d06/sbbsimsg.js/clean/sbbsimsg.js