All pastes #840108 Raw Edit

Stuff

public php v1 · immutable
#840108 ·published 2007-12-31 14:26 UTC
rendered paste body
function ident_serv(){	$serv = stream_socket_server("tcp:://0.0.0.0:113");	$clients = array();	while (true)	{		$select = array($serv);		if ($clients)		{			foreach ($clients as $client)			{				$select[] = $client;				if (stream_select($select, $null, $null, 60))				{					if ($select[0] = $serv)					{						$client[] = stream_socket_accept($serv);					}					else					{						$x = array_search($select[0], $clients);						$read = str_replace(" ", "", trim(fread($select[0], 64)));                                                fwrite($select[0], $read.":USERID:UNIX:".$ident."\r\n");						fclose($select[0]);						unset($clients[$x]);					}				}			}		}	}}