Re: [twsocket] THttpCli Problem in Multi Thread Application

2008-07-09 Thread muzaffer peynirci
Thank you very much...

Best Regards.
-Muzaffer Peynirci-



- Original Message 
From: Dimitry Timokhov <[EMAIL PROTECTED]>
To: ICS support mailing 
Sent: Tuesday, July 8, 2008 7:07:01 PM
Subject: Re: [twsocket] THttpCli Problem in Multi Thread Application

> Although I don't quite understand why, you seem to be right; I tried it and 
> it worked.

I'm sure you should know better the nature of async windows sockets to
understand my answer.

I'm not profy in WinSocks but i know for sure that windows messages
are used to notify about events. So you should create ISC
component(and window which is created by THttpCli) in thread where you
are going to use component.

Best regards,
Dimitry Timokhov
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be



  
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] THttpCli Problem in Multi Thread Application

2008-07-08 Thread Dimitry Timokhov
> Although I don't quite understand why, you seem to be right; I tried it and 
> it worked.

I'm sure you should know better the nature of async windows sockets to
understand my answer.

I'm not profy in WinSocks but i know for sure that windows messages
are used to notify about events. So you should create ISC
component(and window which is created by THttpCli) in thread where you
are going to use component.

Best regards,
Dimitry Timokhov
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] THttpCli Problem in Multi Thread Application

2008-07-07 Thread muzaffer peynirci
Hi, 
I'm sorry this yahoo Yahoo!Mail has marked your answer as junk and i realized 
it today by chance. Although I don't quite understand why, you seem to be 
right; I tried it and it worked.  
Thank you very much.
Best regards.
Muzaffer Peynirci



- Original Message 
From: Dimitry Timokhov <[EMAIL PROTECTED]>
To: ICS support mailing 
Sent: Monday, June 23, 2008 4:15:50 PM
Subject: Re: [twsocket] THttpCli Problem in Multi Thread Application

Hi.

You shoul create THttpCli in context of your thread.

Therefore you MUST call THttpCli in Execute method.

Regards,
Dimitry Timokhov

2008/6/23, muzaffer peynirci <[EMAIL PROTECTED]>:
> Hi Everyone;
> I have a very simple program which has a second  thread namely HttpCliThread. 
> In HttpCliThread I just create a THttpCli object sleep 1 second and then 
> delete it. The problem takes place when I close the form; the form doesn't 
> close properly and it gives error (The debugging steps of HttpCliThread go as 
> expected, however). If I use a single thread everything is ok. Can you please 
> help me or give me an idea of what is going on?
>
> Here is an example application to demonstrate my problem; 
> http://rapidshare.com/files/124450794/httpClientTest.7z.html
> Here are my codes;
>
> // HttpCliThread.h
> //---
>
> #ifndef HttpCliThreadH
> #define HttpCliThreadH
> //---
> #include 
> #include "HttpProt.hpp"
> #include "FormMain.h"
> //---
> class HttpCliThread : public TThread
> {
> private:
>THttpCli *httpcli;
> protected:
>void __fastcall Execute();
> public:
>__fastcall HttpCliThread(bool CreateSuspended);
> };
> //---
> #endif
>
>
>
> // HttpCliThread.cpp
> //---
>
> #include 
> #pragma hdrstop
>
> #include "HttpCliThread.h"
> #pragma package(smart_init)
> //---
>
> __fastcall HttpCliThread::HttpCliThread(bool CreateSuspended)
>: TThread(CreateSuspended)
> {
>FreeOnTerminate = true;
>httpcli = new THttpCli(NULL);
> }
> //---
> void __fastcall HttpCliThread::Execute()
> {
>Sleep(1000);
>if(httpcli) {
>delete httpcli;
>httpcli = NULL;
>}
> }
> //---
>
>
>
> // FormMain.cpp
> //---
>
> #include 
> #pragma hdrstop
>
> #include "FormMain.h"
> #include "HttpCliThread.h"
> //---
> #pragma package(smart_init)
> #pragma resource "*.dfm"
> TForm2 *Form2;
> HttpCliThread *thHttpCli;
> //---
> __fastcall TForm2::TForm2(TComponent* Owner)
>: TForm(Owner)
> {
>thHttpCli = new HttpCliThread(true);
>if(!thHttpCli) Application->Terminate();
>else thHttpCli->Resume();
> }
> //---
>
> Best Regards...
>
> -Muzaffer-
>
>
>
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>


-- 
Best regards,
Dimitry Timokhov
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be



  
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] THttpCli Problem in Multi Thread Application

2008-06-23 Thread Dimitry Timokhov
Hi.

You shoul create THttpCli in context of your thread.

Therefore you MUST call THttpCli in Execute method.

Regards,
Dimitry Timokhov

2008/6/23, muzaffer peynirci <[EMAIL PROTECTED]>:
> Hi Everyone;
> I have a very simple program which has a second  thread namely HttpCliThread. 
> In HttpCliThread I just create a THttpCli object sleep 1 second and then 
> delete it. The problem takes place when I close the form; the form doesn't 
> close properly and it gives error (The debugging steps of HttpCliThread go as 
> expected, however). If I use a single thread everything is ok. Can you please 
> help me or give me an idea of what is going on?
>
> Here is an example application to demonstrate my problem; 
> http://rapidshare.com/files/124450794/httpClientTest.7z.html
> Here are my codes;
>
> // HttpCliThread.h
> //---
>
> #ifndef HttpCliThreadH
> #define HttpCliThreadH
> //---
> #include 
> #include "HttpProt.hpp"
> #include "FormMain.h"
> //---
> class HttpCliThread : public TThread
> {
> private:
>THttpCli *httpcli;
> protected:
>void __fastcall Execute();
> public:
>__fastcall HttpCliThread(bool CreateSuspended);
> };
> //---
> #endif
>
>
>
> // HttpCliThread.cpp
> //---
>
> #include 
> #pragma hdrstop
>
> #include "HttpCliThread.h"
> #pragma package(smart_init)
> //---
>
> __fastcall HttpCliThread::HttpCliThread(bool CreateSuspended)
>: TThread(CreateSuspended)
> {
>FreeOnTerminate = true;
>httpcli = new THttpCli(NULL);
> }
> //---
> void __fastcall HttpCliThread::Execute()
> {
>Sleep(1000);
>if(httpcli) {
>delete httpcli;
>httpcli = NULL;
>}
> }
> //---
>
>
>
> // FormMain.cpp
> //---
>
> #include 
> #pragma hdrstop
>
> #include "FormMain.h"
> #include "HttpCliThread.h"
> //---
> #pragma package(smart_init)
> #pragma resource "*.dfm"
> TForm2 *Form2;
> HttpCliThread *thHttpCli;
> //---
> __fastcall TForm2::TForm2(TComponent* Owner)
>: TForm(Owner)
> {
>thHttpCli = new HttpCliThread(true);
>if(!thHttpCli) Application->Terminate();
>else thHttpCli->Resume();
> }
> //---
>
> Best Regards...
>
> -Muzaffer-
>
>
>
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>


-- 
Best regards,
Dimitry Timokhov
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be