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: CoUninitialize in PostDemo Sample (Web Tool)
chungy

From: Clarksburg, MD USA
Posts: 13
Member Since: 12/29/02
posted January 1, 2003 3:22 PM

Hi,

The CoUninitialize() does exist in the PostDemo sample. Suppose the CoInitialize(NULL) and CoUninitialize() shall be a pair in a program. However, I found out that the PostDemo hung (no any response) for about 1 minute if I put CoUninitialize() right after Destroy(). How does this happen? I am writing a multi-thread application in VC++. I will launch one thread which derived from both CWinThread and IHttp classes. One thread responses for one request. This long delay is not acceptable for my application. Please help. Thnaks.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted January 1, 2003 3:32 PM

Whenever I have problems with Couninitialize I usually just comment it out and it does not seem to have any effect.

If you still have problems, please consult the Microsoft documentation on CoUninitialize. If you still have trouble after that, please contact Microsoft as they would be in a better poisition to assist you with their functions.

chungy

From: Clarksburg, MD USA
Posts: 13
Member Since: 12/29/02
posted January 1, 2003 4:32 PM

Hi Tony,

Happy New Year and thanks for your reply. I found out the it doesn't have any problem when I make HTTP call against the http://www.dart.com/PostSample.asp. I do have a problem when I make HTTP call against my own simple VB WebServer. After the 1 minute no response, mt thread exits which is correct. However the VB side shows "Error: 10053
An established connection was aborted by the software in your host machine..." Do I forget to close the connection? Why don't I have this problem wiht the Dart URL? Could you give some tips? Thanks.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted January 1, 2003 8:28 PM

It sounds like the server closed the connection prematurely. Is this our Webserver control you are talking about?
chungy

From: Clarksburg, MD USA
Posts: 13
Member Since: 12/29/02
posted January 2, 2003 10:29 AM

Hi Rome,

Thanks for your reply. Yes, I use the WebServer Tool as the HTTP server in VB. The following codes is in the WebServer1_Post event call back function.

...
Response.Header.Add httpContentType, "text/plain"
Response.Status = httpOK
Response.Body.Write ("<HTML><BODY>Got XML File(s)<?BODY></HTML>")
Exit Sub

OnError:
...

Did I miss something? Shall I remove the session right after I call Response.Body.Write? Thanks for helping.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted January 2, 2003 10:42 AM

I just tried our WebServer sample ( the current shipping one handles POSTs ) with the PostDemo sample modified to connect to it instead of www.dart.com and I did not see the error you describe until I closed the PostDemo sample.

The reason for the error is because the Web client was still connected when the app was closed and the server lets you know this by throwing that error.

This is normal when using HTTP version 1.1 which keeps the connection open during a session.

chungy

From: Clarksburg, MD USA
Posts: 13
Member Since: 12/29/02
posted January 2, 2003 11:07 AM

Hi Tony,

Thanks for your reply. How can I fix this? Shall I remove the session on the HTTP server side after I call Response.Body.Write? Thanks for helping.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted January 2, 2003 12:55 PM

I'm not sure what you need to fix. It's not really an "error". It's just the server telling you that the client closed the connection. If you don't care about the message, just ignore it.

chungy

From: Clarksburg, MD USA
Posts: 13
Member Since: 12/29/02
posted January 2, 2003 1:29 PM

Hi Tony:

No, it is not an error for the HTTP Server side. However, it is a problem on the HTTP client side. My HTTP Client application will launch a class, which derived from both CWinThread and IHttp, to handle each request. There are more than one at a time. This thread has no response after I receive message from my VB webServer even if I did post out the WM_QUIT. This thread will procress the WM_QUIT after the WebServer show the "client drop connection message. The PostDemo does show this phenomenon because there is only one IHttp object in the application. My client applicatin can't afford to wait for 1 minutes to shut down a thread. Moreover, there is no problem if a run my client application against the http://www.dart.com/PostSample.asp. I have no idea. Is this regardign to "Keep-Alive" header tag? Can I do something on either HTTP Client side or server side to close the connection once I don't need it. Thanks for helping me. I really appreciate it.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted January 2, 2003 1:33 PM

We've taken this issue as far as we can on the forum. Please contact sales@dart.com to make arrangements for purchasing a support package so that we can provide more indepth help.

I would recommed getting "Preferred" support so that we can discuss this over the phone.

chungy

From: Clarksburg, MD USA
Posts: 13
Member Since: 12/29/02
posted January 2, 2003 1:41 PM

Hi Tony,

Thnaks.
Reply | PowerTCP Web for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX