2011-06-01ãã1ã¶æéã®è¨äºä¸è¦§
AnyEvent::JSONRPC::Liteããè¦ç¹ãæãåºãããµã¼ãå é¨ã®condvarãrecvãã¦ããç®æã ãµã¼ãå´ use strict; use warnings; use AnyEvent; use AnyEvent::Handle; use AnyEvent::Socket; use Data::Dumper; tcp_server '127.0.0.1', 8888, sub { my ($fh) â¦
AnyEvent::Handleã®æ±ãã«è¦å´ããã ioãtimerã®ã²ãã£ã¼å¤æ°ã®ããã«undefã§ãè¡ãããåç §ã«ã¦ã³ããæ®ã£ã¦ããã¨ã©ãããããªãã®ãããããAnyEvent::JSONRPC::Liteã§ãweaken $handleã¨ãã£ã¦ããé¨åãã©ããä»ã²ã¨ã¤ç解ã§ããã«ããã®ã ãã大äºã â¦
ããããã¨æ¸ãæ¹ãããï¼ã®ã§è¦å´ããã$handle->destroyããã¨ãããã¨ã¯ã½ã±ããæ¥ç¶ãåãã¨ãããã¨ã§ãããã®ã§ãã©ã®æç¹ã§ããã®ãããã¡ãã¨éä¿¡ãé ã®ä¸ã«æãæµ®ãã¹ãªãã¨ãããªãã ãµã¼ãå´ use strict; use warnings; use AnyEvent; use AnyEvâ¦
AnyEvent::HandleãAnyEvent::Socketã使ããä»åã¯telnetã使ããªãã§tcp_connectã使ã£ã¦ã¿ãã ãµã¼ãå´ãã¨ã³ã¼ããã¯ããæã«æ¹è¡æåãå ¥ããªãã¨ãããããã¯ãã¦ãã¾ãé¨åã§ã¯ã¾ã£ããlineå½¢å¼ã®ãã¼ã¿ã®ããåãã§ã¯æ¹è¡ãå¿ é ãªã®ããªã ãµã¼ãå´â¦
AnyEvent::Handleã使ã£ã¦å¯¾è©±ãããµã¼ããæ¸ã ãµã¼ããç«ã¡ä¸ãã¦telnetã§ã¢ã¯ã»ã¹ããã¨ååãèãããã®ã§çããã次ã«å¹´é½¢ã¾ã§èãã¦ããã®ã§çãã¾ããããã§å¯¾è©±ãçµäºããµã¼ãã®æ¹ããæ¥ç¶ãåã£ã¦ãã¾ããå³åã¯IOç£è¦ã®ä¸ã§ããã«ç£è¦ããã¦ããã¨â¦