登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

SeaRiver Blog

实力才是你一生最好的依靠!

 
 
 

日志

 
 

tcpserver 使用详解  

2010-07-21 09:14:50|  分类: daemontools |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

返回主页
虚拟光驱软件 DaemonTools 安装说明
ucspi-tcp 软件包安装说明
tcpserver 使用详解
设置一个 daytime 服务器
命令行版 tcpserver 安装指南

Getting started with tcpserver

Some people think that using tcpserver is complicated. It really isn't. In the following example you'll run a fake telnetd that simply prints a string to the network and then closes the connection.

Fake telnetd

In a shell window, run this command line:

  tcpserver -v -RHl0 127.0.0.1 2023 sh -c "echo 'Go away!'"  

In another shell window, connect to the fake telnetd:

  telnet 127.0.0.1 2023  

Explanation of tcpserver command line options

  -v  

tcpserver writes status messages to stdout. In a real world setup multilog will pick up the logging information.

  -RHl0  

This prevents various DNS lookups. See the man page for details.

  127.0.0.1 2023  

Listen on 127.0.0.1, port 2023.

  sh -c "echo 'Go away!'"  

This is the program that tcpserver runs upon each connection.

Real world example

A complete setup of a daytime server.


联系我们:

Stefan Krah <website @ bytereef.org>

本站内容由中国分布式计算总站组织翻译。
  评论这张
 
阅读(960)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018