但我的问题是我需要在cmd.exe输入如下命令:
telnet 127.0.0.1 11211
输入以上命令后,cmd打开了一个新命令窗口“Telnet 127.0.0.1”窗口,
我需要在新窗口中输入“stats”命令,并输出结果,不知道如何处理???
11211端口是memcached 默认端口,“stats”命令是memcached的命令。
7 个解决方案
#1
stats命令结果:
STAT pid 3216
STAT uptime 4135
STAT time 1316743110
STAT version 1.4.4-14-g9c660c0
STAT pointer_size 32
STAT curr_connections 5
STAT total_connections 6
STAT connection_structures 6
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 7
STAT bytes_written 0
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT evictions 0
END
STAT pid 3216
STAT uptime 4135
STAT time 1316743110
STAT version 1.4.4-14-g9c660c0
STAT pointer_size 32
STAT curr_connections 5
STAT total_connections 6
STAT connection_structures 6
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 7
STAT bytes_written 0
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT evictions 0
END
#2
我需要把这些结果输出到页面并改成人性化的阅读
#3
telnet调用的是另外一个可执行程序了。是另外一个进程。通过处理cmd是不行了吧?就好比我通过cmd启用sqlplus访问Oracle数据库,你能通过cmd获取我在sqlplus中的命令和输出?
#4
不需要通过CMD来执行telnet,可以直接用process来启动telnet
代码跟执行cmd差不多
代码跟执行cmd差不多
#5
可我不知道在telnet.exe中如何监听11211端口,并且可以顺利执行stats命令?
#6
你可以直接启动telnet的进程啊,为什么非要用cmd呢
#7
在telnet.exe中输入命令:
o 127.0.0.1 [11211]
结果是 could not to conection to host, on port [11211]
o 127.0.0.1 [11211]
结果是 could not to conection to host, on port [11211]
#1
stats命令结果:
STAT pid 3216
STAT uptime 4135
STAT time 1316743110
STAT version 1.4.4-14-g9c660c0
STAT pointer_size 32
STAT curr_connections 5
STAT total_connections 6
STAT connection_structures 6
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 7
STAT bytes_written 0
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT evictions 0
END
STAT pid 3216
STAT uptime 4135
STAT time 1316743110
STAT version 1.4.4-14-g9c660c0
STAT pointer_size 32
STAT curr_connections 5
STAT total_connections 6
STAT connection_structures 6
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 7
STAT bytes_written 0
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT evictions 0
END
#2
我需要把这些结果输出到页面并改成人性化的阅读
#3
telnet调用的是另外一个可执行程序了。是另外一个进程。通过处理cmd是不行了吧?就好比我通过cmd启用sqlplus访问Oracle数据库,你能通过cmd获取我在sqlplus中的命令和输出?
#4
不需要通过CMD来执行telnet,可以直接用process来启动telnet
代码跟执行cmd差不多
代码跟执行cmd差不多
#5
可我不知道在telnet.exe中如何监听11211端口,并且可以顺利执行stats命令?
#6
你可以直接启动telnet的进程啊,为什么非要用cmd呢
#7
在telnet.exe中输入命令:
o 127.0.0.1 [11211]
结果是 could not to conection to host, on port [11211]
o 127.0.0.1 [11211]
结果是 could not to conection to host, on port [11211]