Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Msgbox Modality (Help Please I have been at this for days)


Message #1 by "Stuart Naylor" <indtec@e...> on Mon, 27 Aug 2001 17:07:17 +0100
Thanks for publishing the template of your code Stuart, it helps
understanding the problem better than any words.

First of all, I think you are in the right track (Chris Tacke can
confirm that.) It is better to do things 'right' in the server, and
leave the clients on their own.

What you are trying to implement is a so called 'message pump' to
send asynchronous events. You can find many examples of it in the
web or in good reference books and magazine (vbpj published something
years ago.) Because our server are written in C++, I do not have first
hand experience on VB, but from what I remember it is not that easy
(but doable)

You are right sending the event in 'piggy', but what happens if your server
is asking 'piggy' to send another event while 'piggy' is still waiting
for the client to answer? You can create another 'piggy', but soon you
will have to many pigs around... :-) better to wait until piggy is done
and add the message in a queue.
A quick question: why do you set piggy to Nothing in the Command1_Click
event?

Another thing: be very careful of circular references. Test your application
using the task manager open to see if your servers are shutting down
properly.

m.


  Return to Index