TCPIP-QBSeverSample

The purpose of this sample is to demonstrate how to listen for the socket connection request and how to collect and display data produced by QuickBuild.
QuickBuild can be either client or server, and this sample expects QuickBuild to be client as the sample creates a server socket.
此示例的目的是演示如何监听套接字连接请求以及如何收集和显示 QuickBuild 生成的数据。
QuickBuild 可以是客户端或服务器,并且此示例希望 QuickBuild 成为客户端,因为该示例创建了一个服务器套接字。

As soon as the socket connection is made, the sample launches a thread whose responsibility is to start collecting and displaying data.
一旦建立了套接字连接,示例就会启动一个线程,该线程负责开始收集和显示数据。

.NET provides two classes that assist socket communications–TCPListener and TCPClient. The TcpListener class provides simple methods that listen for and accept incoming connection requests in blocking synchronous mode. The TcpClient class provides simple methods for connecting, and receiving stream data over a network in synchronous blocking mode. This sample program only deals with synchronous blocking mode.
.NET 提供了两个辅助套接字通信的类——TCPListener 和 TCPClient。 TcpListener 类提供了以阻塞同步模式侦听和接受传入连接请求的简单方法。 TcpClient 类提供了以同步阻塞模式通过网络连接和接收流数据的简单方法。 本示例程序只处理同步阻塞模式。

This program launches a thread when the user presses the Listen button. This thread’s responsibility is to look for all the clients that wish to communicate with this sample application. When the user decides to stop listening,the sample closes all client connections, and terminate the thread.
当用户按下 Listen 按钮时,该程序启动一个线程。 该线程的职责是查找所有希望与该示例应用程序通信的客户端。 当用户决定停止监听时,示例关闭所有客户端连接,并终止线程。

Note: This program’s focus is not showing how to write a multi-threaded application, but simply how to listen for the socket connection request and collect and display QuickBuild data.
注意:本程序的重点不在于展示如何编写多线程应用程序,而在于如何监听套接字连接请求并收集和显示 QuickBuild 数据。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值