| Dart Home | PowerTCP Web for ActiveX | Custom Development | Reply | PowerTCP Web for ActiveX Topics | Forums |
| Author | Forum: PowerTCP Web for ActiveX Topic: blocking vs non-blocking mode |
| Barbara Hamby From: Springfield, MO USA Posts: 11 Member Since: 10/04/02 |
posted November 7, 2002 4:36 PM Of course, I'd like to rewrite our program to fully utilize non-blocking mode, but I don't currently have time to do that. So instead I've set up a doevents loop after each non-blocking call to wait for state = httpcompleted. Is that an acceptable way to use non-blocking mode or do I risk running into problems coding this way? I've also got a global "done" variable that I check that is set in the state event when httpcompleted and in the error event. I didn't see another post on this particular subject. The reason I ask is that I've used the Mabry ras and ftp controls in the past and while they initially said this was a valid way to go from blocking to non-blocking with their controls, they later said they don't recommend this particular route any more. Thanks! ************************************************* Here's a sample of the code: Private Sub Http1_State() If Http1.State = httpCompleted Then gbHttpDone = True End If End Sub Private Sub Http1_Error(ByVal Number As DartWebCtl.ErrorConstants, ByVal Description As String) gbHttpDone = True ... ' handle errors End Sub Private Sub SendPacket() sRequestPacket = "my stuff" sResponsePacket = "" With Http1 .Timeout = 0 .Url = "myurl" gbHttpDone = False .Post sRequestPacket, , sResponsePacket Do Until gbHttpDone Or .State = httpCompleted DoEvents Loop End With ... End Sub |
K M Drake![]() From: Utica, NY USA Posts: 3406 Member Since: 07/14/00 |
posted November 8, 2002 8:42 AM Hi, There really is no point in doing this; you might as well use blocking, as this is what you are doing with the loop. -ken |
| ambgabi From: Brooklyn, NY USA Posts: 8 Member Since: 09/26/04 |
posted May 27, 2005 10:32 AM I actually would like to do something similar. Having for instances (array) of the control and wait if non of the is complete. This way hoping to speed up the upload process. Please advise. |
K M Drake![]() From: Utica, NY USA Posts: 3406 Member Since: 07/14/00 |
posted May 27, 2005 2:55 PM Hi, You can certainly create a control array of Web controls, and use them simultaneously in a non-blocking manner (timeout 0, rely on events to know when operations complete). Please be aware, however, that the Http control uses wininet.dll, which places limits on the number of simultaneous connections. See: http://support.microsoft.com/kb/183110 -ken |
| Reply | PowerTCP Web for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|