Click here to Skip to main content
13,047,502 members (58,879 online)
Rate this:
Please Sign up or sign in to vote.
I'm writing code about a system that consist of a server handling multiple client connection.
The link above is the image about the brief idea of how it works.

In the server I use a CDocument-derived class to manage the socket objects and data, as my computer has multiple network adapters, I need a link list to manage the server listening sockets.

I've got no problem of initializing the sockets to different adapters. But I have encounter a problem of passing the connection request to Client Socket list. I can override the Notification Functions(e.g. OnRecieve, OnAccept) but I don't know how to refer the action in the socket(for example changing the data of document class with the data received) back to the document class.

I'm using VS2010 on Windows 7 Ultimate.

Thank you very much.

Posted 25-Jun-11 21:58pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

your socket class needs a member HWND to post (not send) user messages to the main Window that data is updated. Their can you process the data.

I strongly recommand you to divide your socket, document and view. Dont write spaghetti code you will regret it!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 4 Jul 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100