Click here to Skip to main content
15,902,817 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MFC Internals EBook Pin
sunilkumar_prog30-Sep-10 2:14
sunilkumar_prog30-Sep-10 2:14 
AnswerRe: MFC Internals EBook Pin
Eytukan18-Dec-08 6:58
Eytukan18-Dec-08 6:58 
AnswerRe: MFC Internals EBook Pin
CPallini18-Dec-08 10:47
mveCPallini18-Dec-08 10:47 
Questionconfigure local area connection properties programatically Pin
skydiver13518-Dec-08 5:54
skydiver13518-Dec-08 5:54 
AnswerRe: configure local area connection properties programatically Pin
led mike18-Dec-08 6:55
led mike18-Dec-08 6:55 
AnswerRe: configure local area connection properties programatically Pin
Randor 18-Dec-08 6:58
professional Randor 18-Dec-08 6:58 
AnswerRe: configure local area connection properties programatically Pin
Stuart Dootson18-Dec-08 10:42
professionalStuart Dootson18-Dec-08 10:42 
QuestionMFC CSocket and thread: architecture and performance Pin
popacio18-Dec-08 5:43
popacio18-Dec-08 5:43 
I have a question about CSocket and thread.

I have an application server C++/MFC (Visual Studio) that need to have 300 connection always open.
My server receive data from industrial machines and save data into a remote database.

On internet i have seen that many programmers use a thread for every connection that is open.

My application don't create directly a thread for every connection.
I only create a new CSocket object when i receieve a new connection request (i have a csocket that listen for this request).
So i have a list of 300 CSocket object.
I see that operating system / MFC library call OnReceive when machines send data to my server.
Inside the OnReceive() i write machine data in a dedicated file (there is a file for every industrial machine) .Another thread (this is the only working thread that i have created, reads sequentially all these files, do some computations and then sometimes write info into an SQL database.

So, my appliaction has a User Interface thread (created by the Visual studio framwork), a working thread that execute a loop to read all machine files to see if there is new data.
Then there are all these CSocket object that in an asyncronous way execute OnReceive to save data from machine into its file.

I am not sure that this is a good archietecture because with 300 connections my application has become slow.
May be that if i create a separate thread for every connection performance improves ?

When i create a csocket object indirectly i create a thread ?

Which is the difference ?

Thank you for your attention.

Emanuele.
AnswerRe: MFC CSocket and thread: architecture and performance Pin
Mark Salsbery18-Dec-08 6:02
Mark Salsbery18-Dec-08 6:02 
GeneralRe: MFC CSocket and thread: architecture and performance Pin
Eytukan18-Dec-08 6:59
Eytukan18-Dec-08 6:59 
GeneralRe: MFC CSocket and thread: architecture and performance Pin
Mark Salsbery18-Dec-08 7:02
Mark Salsbery18-Dec-08 7:02 
GeneralRe: MFC CSocket and thread: architecture and performance Pin
popacio18-Dec-08 19:59
popacio18-Dec-08 19:59 
AnswerRe: MFC CSocket and thread: architecture and performance Pin
Randor 18-Dec-08 6:20
professional Randor 18-Dec-08 6:20 
GeneralRe: MFC CSocket and thread: architecture and performance Pin
popacio18-Dec-08 20:00
popacio18-Dec-08 20:00 
QuestionHow to tell when an application is being dragged around screen? Pin
KellyR18-Dec-08 5:33
KellyR18-Dec-08 5:33 
AnswerRe: How to tell when an application is being dragged around screen? Pin
Randor 18-Dec-08 5:47
professional Randor 18-Dec-08 5:47 
GeneralRe: How to tell when an application is being dragged around screen? Pin
KellyR18-Dec-08 7:09
KellyR18-Dec-08 7:09 
QuestionError when adding files to C++ Pin
Cozmo2318-Dec-08 4:54
Cozmo2318-Dec-08 4:54 
AnswerRe: Error when adding files to C++ Pin
Jijo.Raj18-Dec-08 4:58
Jijo.Raj18-Dec-08 4:58 
AnswerRe: Error when adding files to C++ Pin
Randor 18-Dec-08 5:09
professional Randor 18-Dec-08 5:09 
AnswerRe: Error when adding files to C++ Pin
timojk18-Oct-09 20:44
timojk18-Oct-09 20:44 
AnswerRe: Error when adding files to C++ Pin
STDF29-Jan-10 4:22
STDF29-Jan-10 4:22 
QuestionTree Control Icons/Image List? Pin
Software200718-Dec-08 3:29
Software200718-Dec-08 3:29 
AnswerRe: Tree Control Icons/Image List? Pin
Jonathan Davies18-Dec-08 4:09
Jonathan Davies18-Dec-08 4:09 
QuestionRadian angle to Quaternion Pin
shaibee18-Dec-08 3:28
shaibee18-Dec-08 3:28 

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.