Login  
Search All Forums
Dart Home | PowerTCP Web for ActiveX | Custom Development Reply | PowerTCP Web for ActiveX Topics | Forums   
AuthorForum: PowerTCP Web for ActiveX
Topic: Multiple instances, non-blocking
User69

Posts: 3
Member Since: 04/30/02
posted April 30, 2002 10:32 AM

The reason for doing trial of DART is that MITC does not support a single instance each running in a separate process, simultaneously executing. I need to have maybe 1 to 20 running all at the same time in separate programs. This approach can be shown to fail in MITC, but also gives an error message in the Web Tool:

Private Sub Command1_Click()
  Dim strURL As String
  Dim lngTimeout As Long
  Dim Content1 As String, Content2 As String, Content3 As String
  Dim Headers1 As DartSock.DartStrings, Headers2 As DartSock.DartStrings, Headers3 As DartSock.DartStrings
  
  strURL = "http://www.google.com/"
  lngTimeout = 0

  Http1.URL = strURL
  Http1.Timeout = lngTimeout

  Http2.URL = strURL
  Http2.Timeout = lngTimeout

  Http3.URL = strURL
  Http3.Timeout = lngTimeout
  
  Debug.Print "Execute 1"
  Http1.Get Content1, Headers1
  Debug.Print "Execute 2"
  Http2.Get Content2, Headers2
  Debug.Print "Execute 3"
  Http2.Get Content3, Headers3
  
  Debug.Print "Start waiting"
  Do While (Http1.State <> httpCompleted) Or (Http2.State <> httpCompleted) Or (Http3.State <> httpCompleted)
    DoEvents
  Loop
  Debug.Print "Done waiting"

End Sub

The error is: Run-time error '9011'":
A method is currently blocking the thread. Some Power Tcp methods are not reentrant. For example, if you set a timer and enter the Get method with a Timeout, and attempt to enter the Get method again, then this error is generated.

This doesn't make sense to me because I believe with ZERO for timeout, these Gets should be non-blocking, and I should not get this error.

Thanks for any advise.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted April 30, 2002 11:00 AM


Hi,
Even in non-blocking, you must wait until one method call has executed before making a second with the same instance of the control.
In your code, change:
Http2.Get Content3, Headers3
to:
Http3.Get Content3, Headers3
and you should be ok.
-ken

K M Drake
Dart Tech Support
User69

Posts: 3
Member Since: 04/30/02
posted April 30, 2002 12:26 PM

KM -

Yes, you are right, how silly of me. I coded it correctly, and indeed had 3 instances running simultaneously in the same process. A feat not possible with the Microsoft Internet Transfer Control (even in SEPARATE processes!), a limitation which is not documented either, I might add. I will continue to do more in depth evaluation with our requirements, but so far it looks extremely good. Thank you for your very timely response.

Best regards - Lee
Reply | PowerTCP Web for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX