示例TCP客户端/服务器应用程序

问题描述:

喜 我需要以下情形的示例应用程序
1)能够接受的请求
的完成端口的TCP服务器 2)客户端进行请求和发送接收操作
3)服务器关闭连接
4)客户端打开另一个插座,用于连接和做派接收操作

Hi I need a sample application of the following scenario
1) IOCP TCP Server capable of accepting request
2) client make request and send receive operation
3) SERVER close the connection
4) client open another socket for connection and do send receive operation

通过这个例子,我想看到​​一个客户端可以打开一个连接,服务器关闭该连接后,又一次成功的连接,可以用做客户端,并再次做派接收操作
如何真正服务器可以处理废弃的连接和插座的遗体打开不必要的??

With this example i want to see how a client can open a connection and after server close that connection another successful connection can made with client and again do send receive operation
How actually server can handle discarded connection and sockets the remains open unwanted ??

请请帮我与
这可以在我身上吹了新的灵魂!!!!

Please Please help me with that
This can blow a new soul in my body !!!!

我写了一系列关于code项目几年前物品presented一套code构建IOCP基于TCP服务器。在code是在C ++中,你的问题是标签的.NET,但它似乎不太可能,你会想开发使用完成端口直接,因为你可以使用各种异步接口方法做同样的事情.NET服务器而不需要让你的手脏东西实际IOCP的一面。

I wrote a series of articles on The Code Project several years ago which presented a set of code for building IOCP based TCP servers. The code is in C++ and your question is tagged ".net" but it would seem unlikely that you'd want to develop a .Net server using IOCP directly since you could use the various async socket methods to do the same thing without needing to get your hands dirty with the actual IOCP side of things.

反正...

第一篇文章就是从这里链接: HTTP:// WWW .serverframework.com /产品---最*framework.html

The first article is linked to from here: http://www.serverframework.com/products---the-free-framework.html

我一直以来的小更新了$ C $钙,可以发现的这里

I've since updated the code a little and it can be found here.

有没有客户端code,但您可以连接到服务器,telnet和发送和recv数据...

There's no client code, but you can connect to the server with telnet and send and recv data...