Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

I/O Completion Ports Code For a Server

Posted on 2004-04-11
3
Medium Priority
?
627 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 750 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 750 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

782 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