Click here to Skip to main content
15,901,122 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: IE Pin
Stephane Rodriguez.30-Oct-02 20:20
Stephane Rodriguez.30-Oct-02 20:20 
GeneralRe: IE Pin
candan30-Oct-02 21:43
professionalcandan30-Oct-02 21:43 
GeneralRe: IE Pin
Stephane Rodriguez.30-Oct-02 21:54
Stephane Rodriguez.30-Oct-02 21:54 
GeneralCListCtrl / CListBox and Icons Pin
JoeSox30-Oct-02 15:39
JoeSox30-Oct-02 15:39 
GeneralRe: CListCtrl / CListBox and Icons Pin
dabs31-Oct-02 4:24
dabs31-Oct-02 4:24 
GeneralRe: CListCtrl / CListBox and Icons Pin
JoeSox31-Oct-02 4:52
JoeSox31-Oct-02 4:52 
GeneralOverlapped I/O and Completion Port :: Winsock Pin
valikac30-Oct-02 12:18
valikac30-Oct-02 12:18 
GeneralRe: Overlapped I/O and Completion Port :: Winsock Pin
User 988530-Oct-02 12:46
User 988530-Oct-02 12:46 
1) You have to keep track. Obviously, you will need all the socket handles stored somewhere. When you run out of socket handles in your list, you know that the IOCompletionPort no longer has any handles it is waiting on?

2) Again, you have to keep a list of socket handles.

My idea would be to create a Connection Manager, that maintains a list of connections (a class that would encapsulate the state of each socket connection, with the socket handle as a member). The pointer to the connection object can be the key on the IOCompletion Port. So, when the IOCompletion Port returns, you have the connection object along with it. Note: You may want to use some other key mechanism (other than using a pointer) because the key variable in the IOCP API is a DWORD and can cause problems when Windows becomes 64 bit.

If the IOcompletionPort crashes, you have to call a cleanup on the connection manager, which will inturn destroy all connection objects, and you can call closesocket in the destructor.

I could not find any API call that gives a list of sockets associated on the IOCP.

Hope this helps.

Thomas

modified 29-Aug-18 21:01pm.

GeneralRe: Overlapped I/O and Completion Port :: Winsock Pin
valikac30-Oct-02 14:08
valikac30-Oct-02 14:08 
GeneralRe: Overlapped I/O and Completion Port :: Winsock Pin
Gerald Schwab30-Oct-02 12:49
Gerald Schwab30-Oct-02 12:49 
GeneralGDI Objects question. Pin
Anonymous30-Oct-02 11:28
Anonymous30-Oct-02 11:28 
GeneralRe: GDI Objects question. Pin
Chris Richardson30-Oct-02 11:46
Chris Richardson30-Oct-02 11:46 
GeneralRe: GDI Objects question. Pin
Anonymous31-Oct-02 3:48
Anonymous31-Oct-02 3:48 
GeneralRe: GDI Objects question. Pin
Chris Richardson31-Oct-02 7:08
Chris Richardson31-Oct-02 7:08 
GeneralRe: GDI Objects question. Pin
Christian Graus30-Oct-02 11:53
protectorChristian Graus30-Oct-02 11:53 
GeneralDocView with tree info... Pin
Nick Jacobs30-Oct-02 11:22
Nick Jacobs30-Oct-02 11:22 
GeneralRe: DocView with tree info... Pin
Chris Richardson30-Oct-02 11:42
Chris Richardson30-Oct-02 11:42 
QuestionHow to load whole file to a CStringEx object ? Pin
ooosawaddee330-Oct-02 11:14
ooosawaddee330-Oct-02 11:14 
AnswerRe: How to load whole file to a CStringEx object ? Pin
Stephane Rodriguez.30-Oct-02 11:17
Stephane Rodriguez.30-Oct-02 11:17 
GeneralI need to detect a float Pin
ns30-Oct-02 11:09
ns30-Oct-02 11:09 
GeneralRe: I need to detect a float Pin
S van Leent30-Oct-02 11:13
S van Leent30-Oct-02 11:13 
GeneralRe: I need to detect a float Pin
alex.barylski30-Oct-02 11:13
alex.barylski30-Oct-02 11:13 
GeneralRe: I need to detect a float Pin
markkuk30-Oct-02 11:34
markkuk30-Oct-02 11:34 
GeneralRe: I need to detect a float Pin
alex.barylski30-Oct-02 14:39
alex.barylski30-Oct-02 14:39 
GeneralRe: I need to detect a float Pin
ns31-Oct-02 1:18
ns31-Oct-02 1:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.