Solved

I/O Completion Ports Code For a Server

Posted on 2004-04-11
3
621 Views
Last Modified: 2007-12-19
Right, I have a program written in C++ that I want to turn into a MUD/RPG Server. i require the following

-Code that I can just plug in, with very little work
-Code that does not use the window message loop, as i do not have one in my app (console app)
-Code that actually works, and instructions on how to use it.
-An  explanation of how it works would be nice also.
-NOT MFC,ATL OR COM

NB. I have tried certain examples from the code project and they have not compiled, so I doubt they will be of any use


Thank You very much in advance, because I have spent hours and fruitless hours searching for what I cannot find.
0
Comment
Question by:Hyperon
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 10801316
Check out http://win32.mvps.org/network/sockhim.html ("Sockets, IOCPs, AcceptEx") and the accompanying code at http://win32.mvps.org/network/sockhim.zip
0
 
LVL 4

Assisted Solution

by:booki
booki earned 250 total points
ID: 10802022
Hyperon,

A "SocketServer" class with i/o worker threads that handle all socket reads and writes and non i/o worker threads to handle the business logic.  It implements all the requirements you have listed above.

"Writing a high performance server that runs on Windows NT and uses sockets to communicate with the outside world isn't that hard once you dig through the API references. What's more most of the code is common between all of the servers that you're likely to want to write. It should be possible to wrap all of the common code up in some easy to reuse classes. However, when I went looking for some classes to use to write my first socket server all of the examples and articles that I found required the user to pretty much start from scratch or utilise "cut and paste reuse" when they wanted to use the code in their own servers. Also the more complicated examples, ones that used io completion ports for example, tended to stop short of demonstrating real world usage. After all, anyone can write an echo server..."

Full Article and Code.
Article: http://www.developerfusion.com/show/2498/1/
Article: http://www.developerfusion.com/show/4444/
Source Code: http://www.developerfusion.com/files/f_4444.zip

b.

0
 

Author Comment

by:Hyperon
ID: 10803055
booki, i dont know, i just cant seem to grasp that code you've given, in any case, i dont really like wrapper classe, i hae to go and split them up later for my purposes that way. but, to be fair, this is what i asked for, so ill split the points
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question