/* DirectoryRegister Server - Jan 2000 - Sylvain Huet */
/* gethostbyname part */
/* 1.0 */

defcom Cdefip=defip S;;

typeof ip=S;;

fun clock(a,b)=_closemachine;;

fun main(ad,port)=
 set ip=_gethostbyname ad;
 if nil==_openchannel strcat ":" itoa port nil _envchannel _channel
 then _closemachine else
 (_rfltimer _starttimer _channel 10000 @clock nil;
  nil);;

fun _connected()=_on _channel Cdefip [ip];;

fun _closed()=_closemachine;;