Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

I/O Completion Ports Code For a Server

Posted on 2004-04-11
3
Medium Priority
?
626 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

722 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