FW: Post question.

Hi Brian,

What you're actually saying is that you want to perform a _synchronous_
operation. You can do that very easily if you use blocking sockets, instead
of the default, which is nonblocking sockets. If you do that, the program
will hold until the post is finished, and you won't need an event loop at
all.
On the other hand, you have to ask yourself if this is really what you want
to do. Usually when writing a professional program you would want to use
asynchronous operations with nonblocking sockets, because the time it may
take to perform the request is unperdicatable, and you would still like to
control your program (for example, if you want to let the user cancel the
operation).
Hope this helps,
Yaniv.

Yaniv Ben-Yosef
Contact Networks http://www.contact.com

  -----Original Message-----
  From: www-lib-request@w3.org [mailto:www-lib-request@w3.org]On Behalf Of
Brian Svihovec
  Sent: Monday, May 01, 2000 6:26 AM
  To: www-lib@w3.org
  Subject: Post question.


  In the example programs for posting form data to a server, the program
begins the post and then enters the event loop.  When this operation is done
the termination function is called and the program is exited from there.

  I would like to write a function that will perform a post, and when it is
done, it will return control to the original calling function.  Is there a
way to have the event loop exit, and then have control returned back to the
original calling function instead of exiting the entire program?  (ex. main
calls MyPost and when MyPost is done it returns to main?)

  Thanks,
  Brian

Received on Monday, 1 May 2000 04:54:21 UTC