Click here to Skip to main content
15,912,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Template Troubles Pin
jbarton21-Jun-02 10:36
jbarton21-Jun-02 10:36 
GeneralRe: Template Troubles (Solved) Pin
Raskolnikov21-Jun-02 13:27
Raskolnikov21-Jun-02 13:27 
GeneralRe: Template Troubles (Solved) Pin
Paul M Watt21-Jun-02 18:30
mentorPaul M Watt21-Jun-02 18:30 
GeneralRe: Template Troubles (Solved) Pin
Tim Smith22-Jun-02 4:56
Tim Smith22-Jun-02 4:56 
GeneralRe: Template Troubles (Solved) Pin
Raskolnikov22-Jun-02 10:09
Raskolnikov22-Jun-02 10:09 
Generalimage copying problem Pin
SilentWarrior21-Jun-02 8:12
SilentWarrior21-Jun-02 8:12 
GeneralRe: image copying problem Pin
Speedy21-Jun-02 11:33
Speedy21-Jun-02 11:33 
GeneralConfused about Bound sockets and deamons Pin
Jason Hihn21-Jun-02 7:51
Jason Hihn21-Jun-02 7:51 
I have a program that I wrote that works like s webserver, or I want it to anyway. Clients will connect to a socket do something, then disconnect. Currently, I'm seeing weird behavior, but everythign is weird because this is new to me.

First, I'm using a socket wrapper from PJ Naughter's W3Mfc project.

I am under the impression that with web servers you connect to a well-known socket. Then the server 'bounces' you to a new socket so it can accept the next connection. The bounced connection is handled by a thread.

In my code, I have a basic server that Bind()s, Accept()s and allows for 5 connections.

In one function (and thread) I:
setup the server socket,
enter a while loop,
wait for an accept(),
do my stuff over the socket,
then close it.

Should I be firing off a new thread after I accept()?

Originally the code was written to handle a few connections a minute, but it looks like it may do several dozen now. I'm seeing the first 6 connections get accepted.. then the next few fail, then it's spotty. Would firing off a new thread fix this? How do I Accept() and start a thread safely (how do I pass the connected socket to the new thread?)

Thank you for your time.

GeneralRe: Confused about Bound sockets and deamons Pin
21-Jun-02 10:28
suss21-Jun-02 10:28 
GeneralRe: Confused about Bound sockets and deamons Pin
jferrell121123-Jun-02 3:37
jferrell121123-Jun-02 3:37 
GeneralSend Message WM_CLOSE Pin
MyEden21-Jun-02 7:16
MyEden21-Jun-02 7:16 
GeneralRe: Send Message WM_CLOSE Pin
21-Jun-02 9:34
suss21-Jun-02 9:34 
GeneralRe: Send Message WM_CLOSE Pin
MyEden21-Jun-02 22:01
MyEden21-Jun-02 22:01 
GeneralMySql++ Pin
klawipo21-Jun-02 6:37
klawipo21-Jun-02 6:37 
GeneralA printing problem Pin
Vincent Ye21-Jun-02 6:08
Vincent Ye21-Jun-02 6:08 
GeneralRe: A printing problem Pin
Carlos Antollini21-Jun-02 6:23
Carlos Antollini21-Jun-02 6:23 
GeneralRe: A printing problem Pin
Roger Allen21-Jun-02 6:27
Roger Allen21-Jun-02 6:27 
GeneralRe: A printing problem Pin
Vincent Ye21-Jun-02 9:02
Vincent Ye21-Jun-02 9:02 
GeneralPalm Problem.. Pin
Renjith Ramachandran21-Jun-02 5:49
Renjith Ramachandran21-Jun-02 5:49 
GeneralRe: Palm Problem.. Pin
Mike Nordell23-Jun-02 18:05
Mike Nordell23-Jun-02 18:05 
GeneralETSLayoutFormView, scrollbars missing. Pin
aldeba21-Jun-02 5:26
aldeba21-Jun-02 5:26 
GeneralTIP: When your program suddenly stops loading Pin
Jason Hooper21-Jun-02 5:16
Jason Hooper21-Jun-02 5:16 
GeneralRe: TIP: When your program suddenly stops loading Pin
Neville Franks21-Jun-02 11:37
Neville Franks21-Jun-02 11:37 
GeneralRe: TIP: When your program suddenly stops loading Pin
Jason Hooper22-Jun-02 1:33
Jason Hooper22-Jun-02 1:33 
QuestionHow can I tell if an app has shut down? Pin
Paresh Solanki21-Jun-02 5:14
Paresh Solanki21-Jun-02 5:14 

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.