Sample TCP Client/Server Application
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 operationWith 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 !!!!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.
Anyway...
The first article is linked to from here: http://www.serverframework.com/products---the-free-framework.html
I've since updated the code a little and it can be found here.
There's no client code, but you can connect to the server with telnet and send and recv data...
精彩评论