Re: Something like "ping" for windows messages.




Geoff Joy wrote:
If you are using MFC then it is not Win16, the old code might have been Win16
but you have now stepped outside that paradigm. Sending yourself WM_TIMER
messages was a way of assuring a message would arrive for your application in
Win16 since GetMessage was a yield of CPU to the OS. I suspect the original
application may have had some kind of polling it was doing, hence the timer.

Correct.

There are also some
issues to be aware of, depending on if you are using CSocket or CAsyncSocket.
Refer to the experts in winsock for advice there.

I've read a faq somewhere on sockets that wasn't very complementary
about CSocket. In this case, the server is using CAsyncSocket but the
article wasn't too happy about that either! In the past I've always
used Win32/socket calls and many threads so I'm on a learning curve
with MFC classes.

The HTTP server portion should run in it's own thread if you think it will impact the message pump.

I'm 99% sure a thread would help. Just trying to get a rough idea of
what the benefit might be and, if I did the work, if I helped matters.
Threads are great but I've found that adding them to a design after the
event can cause lots of headaches - lots of thread unsafe code around
sometimes. Those kinds of bugs are nasty to track down. So I only use
them when I know they're of benefit.

Use NETMON to sniff the wire to measure the latency in your TCP server.

This might help your probing:

Try starting the performance timer at the end of the message loop and stopping
at the start (with appropriate trapdoors of course) to see how long your process
was suspended. I have tested this in a simple hello world application and when
there are no messages the message loop remains idle and the idle time is
recorded by the timer when the next message arrives. (Mouse moves are 10ms, the
smallest message interval I saw was 16uS.)

I think I see what you're saying. My MFC knowledge is fairly basic.
How would I insert this code in the message loop? Isn't that hidden
away in the MFC library? If you have a simple hello world demo to hand
then perhaps that'd explain it best. My e-mail address is Peter dot
Smithson at gmail.com. Thanks.

I recommend letting the HTTP server idle out with no connections and see if it
blocks the message loop.

I'm not sure I've understood you there. If the http server isn't doing
anything then I'd have thought I'd be 100% gaurenteed that there'd be
no message loop being blocked. This http server is already built into
our server and the server certainly still works when there are no http
requests.

Thanks.

Peter.

.



Relevant Pages

  • Re: Interpreting RPC extended error information: detection location 2?
    ... The GUI process is mostly retrieving information from the server ... Whenever it makes a COM call to the server, it spins its message loop ... request and receive the ORPC response, ...
    (microsoft.public.win32.programmer.ole)
  • Re: Restaurant Rules as written by your server
    ... the server for the coffee and walked out. ... One thing that *really* bugs me as a customer is when the server arrives at ... So of course the mains were chicken stuffed with prawns, fish in a lobster bisque and filet steak with pancetta. ... I ordered it medium, and my neighbour, a nice woman but a bit daffy, ordered hers well done. ...
    (rec.food.cooking)
  • Re: Expired continued
    ... granted charitable licence for the replacement server. ... Standard W2K3 rather than the Small Business W2K3 SBS. ... Microsoft is in process of providing the SBS, but I need to keep things ... I am hoping that when the new S/W arrives that it will load over the dormant ...
    (microsoft.public.windows.server.sbs)
  • Re: A message rule question
    ... Apply this rule after the message arrives refers to On The Server. ... While some rules require the message to be downloaded before it is applied, such as a message body rule, a size rule can be deleted from the server. ... You can also set the action to Do not download from server. ... The question arrives in the rule description which says "Apply this ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Emails always arrive late
    ... message sent to all users arrives instantly in all users ... mailboxes except this person where the message takes a ... This user has Windows XP and Outlook 2000 with almost all ... has a mailbox on the server with about 500 MB of data. ...
    (microsoft.public.outlook)