Click here to Skip to main content
15,919,434 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Sorting out duplicate drives... Pin
dandy7213-Nov-03 2:38
dandy7213-Nov-03 2:38 
GeneralRe: Sorting out duplicate drives... Pin
Terry O'Nolley12-Nov-03 10:22
Terry O'Nolley12-Nov-03 10:22 
GeneralUDP Client Pin
NewHSKid12-Nov-03 4:19
NewHSKid12-Nov-03 4:19 
GeneralRe: UDP Client Pin
Peter Molnar12-Nov-03 12:58
Peter Molnar12-Nov-03 12:58 
GeneralDeveloping, building, and testing. How do it the best? Learning from the world leader - Microsoft Pin
gicio12-Nov-03 3:36
gicio12-Nov-03 3:36 
GeneralRe: Developing, building, and testing. How do it the best? Learning from the world leader - Microsoft Pin
David Crow12-Nov-03 4:44
David Crow12-Nov-03 4:44 
GeneralWinsock ? Again Pin
Stan the man12-Nov-03 3:30
Stan the man12-Nov-03 3:30 
GeneralRe: Winsock ? Again Pin
Antti Keskinen12-Nov-03 3:47
Antti Keskinen12-Nov-03 3:47 
Each port can simultaneously connect to a single server, so that is correct.

However, you can start a seperate thread which monitors ALL the open ports. Afterall, checking a port isn't a long process, so this shouldn't cause any timing issues.

Now, instead of opening dozens of ports, I suggest that you formulate the data sent by the server, if that is possible. Place a identification number in front of each data packet to tell your program from which 'virtual port' this packet is coming from. This way you can open 'multiple' connections to a single server using only single physical port.

The event driven method is appropriate, considering that you created a seperate thread to handle the port. Now, when a port event occurs, the handler thread is notified. At this point, save the data to a temporary variable, free the port and notify your application that new data is available. This way the port is freed quickly, but the transfer of data from the port to the application isn't in a terrible hurry. This is called data buffering.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: Winsock ? Again Pin
Pir8ofTampa12-Nov-03 3:55
Pir8ofTampa12-Nov-03 3:55 
GeneralRe: Winsock ? Again Pin
Peter Molnar12-Nov-03 13:03
Peter Molnar12-Nov-03 13:03 
GeneralCheckBoxes in setup Pin
BoudewijnEctor12-Nov-03 3:17
BoudewijnEctor12-Nov-03 3:17 
GeneralRe: CheckBoxes in setup Pin
David Crow12-Nov-03 3:29
David Crow12-Nov-03 3:29 
GeneralRe: CheckBoxes in setup Pin
BoudewijnEctor12-Nov-03 4:04
BoudewijnEctor12-Nov-03 4:04 
GeneralRe: CheckBoxes in setup Pin
David Crow12-Nov-03 4:08
David Crow12-Nov-03 4:08 
GeneralRe: CheckBoxes in setup Pin
BoudewijnEctor12-Nov-03 4:38
BoudewijnEctor12-Nov-03 4:38 
GeneralRe: CheckBoxes in setup Pin
David Crow12-Nov-03 4:54
David Crow12-Nov-03 4:54 
GeneralRe: CheckBoxes in setup Pin
BoudewijnEctor2-Dec-03 21:55
BoudewijnEctor2-Dec-03 21:55 
GeneralRe: CheckBoxes in setup Pin
David Crow3-Dec-03 2:54
David Crow3-Dec-03 2:54 
GeneralRe: CheckBoxes in setup Pin
Maximilien12-Nov-03 4:49
Maximilien12-Nov-03 4:49 
GeneralChange Printer Port Pin
Andy H12-Nov-03 3:04
Andy H12-Nov-03 3:04 
GeneralMFC and COM, and Access violation in CoUninitialize Pin
sagmam12-Nov-03 2:55
sagmam12-Nov-03 2:55 
GeneralRe: MFC and COM, and Access violation in CoUninitialize Pin
Antti Keskinen12-Nov-03 3:38
Antti Keskinen12-Nov-03 3:38 
GeneralRe: MFC and COM, and Access violation in CoUninitialize Pin
sagmam12-Nov-03 4:06
sagmam12-Nov-03 4:06 
GeneralRe: MFC and COM, and Access violation in CoUninitialize Pin
Pir8ofTampa12-Nov-03 4:32
Pir8ofTampa12-Nov-03 4:32 
GeneralRe: MFC and COM, and Access violation in CoUninitialize Pin
sagmam12-Nov-03 23:05
sagmam12-Nov-03 23:05 

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.