Re: [twsocket] Fw: Sync THttpConnection derivative

2005-10-14 Thread Fastream Technologies
Thank you for your interest. I think the problem is in PHP5isapi.dll. Other 
pure ISAPI DLLs work very well.

Best Regards,

SZ

- Original Message - 
From: Dan [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Friday, October 14, 2005 2:48 AM
Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 Sounds like a race condition.  Stepping through the code slows the 
 debugged
 thread and stops it occurring.

 Dan

 - Original Message - 
 From: Fastream Technologies [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Wednesday, October 12, 2005 9:34 AM
 Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


I still have not been able to pinpoint the problem but I have a clue: The
AV
 occurs when the ISAPI interface is used to run php5isapi.dll and not 
 other
 ISAPI dll's and I read that PHP5 is not fully thread-safe. So it is
 probably
 a PHP bug...

 Again, thank you very much for your help.

 Best Regards,

 SubZ

 - Original Message - 
 From: Francois Piette [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Wednesday, October 12, 2005 9:43 AM
 Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 I did the Attach process trick.

 I would call it a feature :-)

 It is very weird that the bug now does not
 occur when I go line-by-line in the debugger but occurs when I hit F9.
 :(( I
 will continue tomorrow...

 Use Windows.OutputDebugString here and there to find out where the error
 occur.
 Use CTRL+ALT+V to see messages outputed by OutpuDebugMessage.

 --
 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html
 --
 [EMAIL PROTECTED]
 Author of ICS (Internet Component Suite, freeware)
 Author of MidWare (Multi-tier framework, freeware)
 http://www.overbyte.be


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

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


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

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


Re: [twsocket] Fw: Sync THttpConnection derivative

2005-10-13 Thread Dan
Sounds like a race condition.  Stepping through the code slows the debugged 
thread and stops it occurring.

Dan

- Original Message - 
From: Fastream Technologies [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Wednesday, October 12, 2005 9:34 AM
Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


I still have not been able to pinpoint the problem but I have a clue: The 
AV
 occurs when the ISAPI interface is used to run php5isapi.dll and not other
 ISAPI dll's and I read that PHP5 is not fully thread-safe. So it is 
 probably
 a PHP bug...

 Again, thank you very much for your help.

 Best Regards,

 SubZ

 - Original Message - 
 From: Francois Piette [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Wednesday, October 12, 2005 9:43 AM
 Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 I did the Attach process trick.

 I would call it a feature :-)

 It is very weird that the bug now does not
 occur when I go line-by-line in the debugger but occurs when I hit F9.
 :(( I
 will continue tomorrow...

 Use Windows.OutputDebugString here and there to find out where the error
 occur.
 Use CTRL+ALT+V to see messages outputed by OutpuDebugMessage.

 --
 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html
 --
 [EMAIL PROTECTED]
 Author of ICS (Internet Component Suite, freeware)
 Author of MidWare (Multi-tier framework, freeware)
 http://www.overbyte.be


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

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

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


Re: [twsocket] Fw: Sync THttpConnection derivative

2005-10-12 Thread Francois Piette
 I did the Attach process trick. 

I would call it a feature :-)

 It is very weird that the bug now does not 
 occur when I go line-by-line in the debugger but occurs when I hit F9. :(( I 
 will continue tomorrow...

Use Windows.OutputDebugString here and there to find out where the error occur.
Use CTRL+ALT+V to see messages outputed by OutpuDebugMessage.

--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be


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


Re: [twsocket] Fw: Sync THttpConnection derivative

2005-10-11 Thread Fastream Technologies
Debugger, just like the MessageBox showed correct values!

However the socket printed something with a first line like:

 ÿº

(This was suppose to be a long line but OE only printed this much!)

Regards,

SubZ

- Original Message - 
From: Francois PIETTE [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Monday, October 10, 2005 7:33 PM
Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 I still get garbage data with NO HTTP header.
 Any idea why?

 No idea why. But did you use the debugger to verify that Data and DataLen
 have correct values ?

 To debug further, you can add an Windows.OutputDebugString in
 WSocket_Synchronized_send function to display what is really sent by the
 component, no matter if called normally by the component or by a direct
 call to WSocket_Send. To see messages printed out by OutputDebugString, 
 you
 simply hit CTRL+ALT+V within Delphi (Probably the same with BCB).

 --
 Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
 --
 [EMAIL PROTECTED]
 http://www.overbyte.be




 - Original Message - 
 From: Fastream Technologies [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Monday, October 10, 2005 4:45 PM
 Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 Hello and thanks for your replies,

 I now have the following code that do not raise any exception:

 In the connection class derived from TWebConnection:

Pause();

int iMode = 0;
WSocket_ioctlsocket(HSocket, FIONBIO, iMode);

if(!serverThread-DXISAPI-Execute(this,
ISAPIInterpreter,
Method,
Params,
Path,
LastFilePath,
RequestContentType, POSTString,
 postedDataLen, scriptResult))
result = dpError;
else
{
iMode = 1;
if(WSocket_ioctlsocket(HSocket, FIONBIO, iMode))
{
Resume();
Close();
}
else
Resume();
}

 and in the TWebConnection that is derived from THttpConnection and can be
 called from pascal DXISAPI code by callback functions:

OldDataAvailable := FOnDataAvailable;
OldSendData := FOnSendData;
OldDataSent := FOnDataSent;
FOnDataAvailable := nil;
FOnSendData := nil;
FOnDataSent := nil;

if FTerminated or
((State  wsConnected) and (State  wsSocksConnected)) then
begin
Result := false;
Exit;
end;

Count := WSocket_send(HSocket,
Data,
DataLen,
0);

Result := Count  0;
if Result = true then
DataSent := DataSent + Count;

if FTerminated or
((State  wsConnected) and (State  wsSocksConnected)) then
begin
Result := false;
end;

if Result = true then
begin
FOnDataAvailable := OldDataAvailable;
FOnSendData := OldSendData;
FOnDataSent := OldDataSent;
end;

 I still get garbage data with NO HTTP header.

 Any idea why?

 Best Regards,

 SubZ

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

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


Re: [twsocket] Fw: Sync THttpConnection derivative

2005-10-11 Thread Francois Piette
 Debugger, just like the MessageBox showed correct values!

Do you still have message box in the code ? This may cause the problem because 
it call the message
pump and wsocket_send may be called from elsewhere. Never use MessageBox to 
show values, use
Windows.OutputDebugString or use Writeln (don't forget to make your app a 
console mode app).

Maybe I found the problem. WSocket_send is defined as:
function WSocket_send(s: TSocket; var Buf; len, flags: Integer): Integer;

This means you have t call it like this:
   Count := WSocket_send(HSocket,  Data^, DataLen, 0);

See the ^ that I added. Since the Buf argument is declare as untype var, the 
compiler
automatically take the address. So when you pas Data, then it is the pointer 
address that is
passed. When you pass Data^, the actual pointer value is passed.

--
[EMAIL PROTECTED]
http://www.overbyte.be


- Original Message - 
From: Fastream Technologies [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, October 11, 2005 9:13 AM
Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 Debugger, just like the MessageBox showed correct values!

 However the socket printed something with a first line like:

  ÿº

 (This was suppose to be a long line but OE only printed this much!)

 Regards,

 SubZ

 - Original Message - 
 From: Francois PIETTE [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Monday, October 10, 2005 7:33 PM
 Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


  I still get garbage data with NO HTTP header.
  Any idea why?
 
  No idea why. But did you use the debugger to verify that Data and DataLen
  have correct values ?
 
  To debug further, you can add an Windows.OutputDebugString in
  WSocket_Synchronized_send function to display what is really sent by the
  component, no matter if called normally by the component or by a direct
  call to WSocket_Send. To see messages printed out by OutputDebugString,
  you
  simply hit CTRL+ALT+V within Delphi (Probably the same with BCB).
 
  --
  Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
  --
  [EMAIL PROTECTED]
  http://www.overbyte.be
 
 
 
 
  - Original Message - 
  From: Fastream Technologies [EMAIL PROTECTED]
  To: ICS support mailing twsocket@elists.org
  Sent: Monday, October 10, 2005 4:45 PM
  Subject: Re: [twsocket] Fw: Sync THttpConnection derivative
 
 
  Hello and thanks for your replies,
 
  I now have the following code that do not raise any exception:
 
  In the connection class derived from TWebConnection:
 
 Pause();
 
 int iMode = 0;
 WSocket_ioctlsocket(HSocket, FIONBIO, iMode);
 
 if(!serverThread-DXISAPI-Execute(this,
 ISAPIInterpreter,
 Method,
 Params,
 Path,
 LastFilePath,
 RequestContentType, POSTString,
  postedDataLen, scriptResult))
 result = dpError;
 else
 {
 iMode = 1;
 if(WSocket_ioctlsocket(HSocket, FIONBIO, iMode))
 {
 Resume();
 Close();
 }
 else
 Resume();
 }
 
  and in the TWebConnection that is derived from THttpConnection and can be
  called from pascal DXISAPI code by callback functions:
 
 OldDataAvailable := FOnDataAvailable;
 OldSendData := FOnSendData;
 OldDataSent := FOnDataSent;
 FOnDataAvailable := nil;
 FOnSendData := nil;
 FOnDataSent := nil;
 
 if FTerminated or
 ((State  wsConnected) and (State  wsSocksConnected)) then
 begin
 Result := false;
 Exit;
 end;
 
 Count := WSocket_send(HSocket,
 Data,
 DataLen,
 0);
 
 Result := Count  0;
 if Result = true then
 DataSent := DataSent + Count;
 
 if FTerminated or
 ((State  wsConnected) and (State  wsSocksConnected)) then
 begin
 Result := false;
 end;
 
 if Result = true then
 begin
 FOnDataAvailable := OldDataAvailable;
 FOnSendData := OldSendData;
 FOnDataSent := OldDataSent;
 end;
 
  I still get garbage data with NO HTTP header.
 
  Any idea why?
 
  Best Regards,
 
  SubZ
 
  -- 
  To unsubscribe or change your settings for TWSocket mailing list
  please goto http://www.elists.org/mailman/listinfo/twsocket
  Visit our website at http://www.overbyte.be

Re: [twsocket] Fw: Sync THttpConnection derivative

2005-10-11 Thread Fastream Technologies
YES! The ^ did the trick. I knew it was because of my missing pascal 
knowledge... ;)

Thank you,

SZ

- Original Message - 
From: Francois Piette [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, October 11, 2005 10:38 AM
Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 Debugger, just like the MessageBox showed correct values!

Do you still have message box in the code ? This may cause the problem 
because it call the message
pump and wsocket_send may be called from elsewhere. Never use MessageBox to 
show values, use
Windows.OutputDebugString or use Writeln (don't forget to make your app a 
console mode app).

Maybe I found the problem. WSocket_send is defined as:
function WSocket_send(s: TSocket; var Buf; len, flags: Integer): Integer;

This means you have t call it like this:
   Count := WSocket_send(HSocket,  Data^, DataLen, 0);

See the ^ that I added. Since the Buf argument is declare as untype var, 
the compiler
automatically take the address. So when you pas Data, then it is the 
pointer address that is
passed. When you pass Data^, the actual pointer value is passed.

--
[EMAIL PROTECTED]
http://www.overbyte.be


- Original Message - 
From: Fastream Technologies [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, October 11, 2005 9:13 AM
Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 Debugger, just like the MessageBox showed correct values!

 However the socket printed something with a first line like:

  ÿº

 (This was suppose to be a long line but OE only printed this much!)

 Regards,

 SubZ

 - Original Message - 
 From: Francois PIETTE [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Monday, October 10, 2005 7:33 PM
 Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


  I still get garbage data with NO HTTP header.
  Any idea why?
 
  No idea why. But did you use the debugger to verify that Data and 
  DataLen
  have correct values ?
 
  To debug further, you can add an Windows.OutputDebugString in
  WSocket_Synchronized_send function to display what is really sent by the
  component, no matter if called normally by the component or by a 
  direct
  call to WSocket_Send. To see messages printed out by OutputDebugString,
  you
  simply hit CTRL+ALT+V within Delphi (Probably the same with BCB).
 
  --
  Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
  --
  [EMAIL PROTECTED]
  http://www.overbyte.be
 
 
 
 
  - Original Message - 
  From: Fastream Technologies [EMAIL PROTECTED]
  To: ICS support mailing twsocket@elists.org
  Sent: Monday, October 10, 2005 4:45 PM
  Subject: Re: [twsocket] Fw: Sync THttpConnection derivative
 
 
  Hello and thanks for your replies,
 
  I now have the following code that do not raise any exception:
 
  In the connection class derived from TWebConnection:
 
 Pause();
 
 int iMode = 0;
 WSocket_ioctlsocket(HSocket, FIONBIO, iMode);
 
 if(!serverThread-DXISAPI-Execute(this,
 ISAPIInterpreter,
 Method,
 Params,
 Path,
 LastFilePath,
 RequestContentType, POSTString,
  postedDataLen, scriptResult))
 result = dpError;
 else
 {
 iMode = 1;
 if(WSocket_ioctlsocket(HSocket, FIONBIO, iMode))
 {
 Resume();
 Close();
 }
 else
 Resume();
 }
 
  and in the TWebConnection that is derived from THttpConnection and can 
  be
  called from pascal DXISAPI code by callback functions:
 
 OldDataAvailable := FOnDataAvailable;
 OldSendData := FOnSendData;
 OldDataSent := FOnDataSent;
 FOnDataAvailable := nil;
 FOnSendData := nil;
 FOnDataSent := nil;
 
 if FTerminated or
 ((State  wsConnected) and (State  wsSocksConnected)) then
 begin
 Result := false;
 Exit;
 end;
 
 Count := WSocket_send(HSocket,
 Data,
 DataLen,
 0);
 
 Result := Count  0;
 if Result = true then
 DataSent := DataSent + Count;
 
 if FTerminated or
 ((State  wsConnected) and (State  wsSocksConnected)) then
 begin
 Result := false;
 end;
 
 if Result = true then
 begin
 FOnDataAvailable := OldDataAvailable;
 FOnSendData := OldSendData

Re: [twsocket] Fw: Sync THttpConnection derivative

2005-10-11 Thread Francois Piette
 But the error does not happen when debugging. It only occurs in service mode
 which is not debuggable. That's the whole problem!

You can debug services !
Compile your service, run it as a service. Then go to Delphi/BCB run menu and 
select attach to
processus (or similar designation: I have a french version). Then select your 
service process.

--
[EMAIL PROTECTED]
http://www.overbyte.be

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


Re: [twsocket] Fw: Sync THttpConnection derivative

2005-10-11 Thread Arno Garrels
Fastream Technologies wrote:
 The problem seems to be in kernel32.dll. Could it be related to the
 NexusMM that we are only using with the service? It is still strange
 because the error is given before quiting, ISAPI code is run...

It is (mostly) impossible for mailing list users to debug other peoples
'remote' services. Francois mentioned one resolution, another is MadExcept,
or try Wilfried's service class. You could also use the (commercial) SVCOM
components, they provide a DLL that emulates the SCM and therefore allows
debugging a service like any other GUI application. 


 Best Regards,
 
 SubZ
 
 - Original Message -
 From: Francois Piette [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Tuesday, October 11, 2005 3:08 PM
 Subject: Re: [twsocket] Fw: Sync THttpConnection derivative
 
 
 But the error does not happen when debugging. It only occurs in service
 mode
 which is not debuggable. That's the whole problem!
 
 You can debug services !
 Compile your service, run it as a service. Then go to Delphi/BCB run menu
 and select attach to
 processus (or similar designation: I have a french version). Then select
 your service process.
 
 --
 [EMAIL PROTECTED]
 http://www.overbyte.be
 
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Fw: Sync THttpConnection derivative

2005-10-11 Thread Fastream Technologies
Thanks for your replies (Francois and Arno).

I tried to log with CodeGuard and EurekaLog and both failed (CodeGuard app 
did not start as a service and EurelaLog did not trigger when Windows 
complained). I saw the following error on the Event Viewer:

Faulting application NetFileServerEngine.exe, version 7.9.0.1199, faulting 
module unknown, version 0.0.0.0, fault address 0x01d4e195.

Regards,

SZ

- Original Message - 
From: Francois Piette [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, October 11, 2005 4:26 PM
Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 The problem maybe in kernel32 because you pass an invalid argument value 
 to an API function. Try to
 find what kernel32 function is called and from where in your program.

 --
 [EMAIL PROTECTED]
 http://www.overbyte.be


 - Original Message - 
 From: Fastream Technologies [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Tuesday, October 11, 2005 3:04 PM
 Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 The problem seems to be in kernel32.dll. Could it be related to the 
 NexusMM
 that we are only using with the service? It is still strange because the
 error is given before quiting, ISAPI code is run...

 Best Regards,

 SubZ

 - Original Message - 
 From: Francois Piette [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Tuesday, October 11, 2005 3:08 PM
 Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


  But the error does not happen when debugging. It only occurs in 
  service
  mode
  which is not debuggable. That's the whole problem!
 
  You can debug services !
  Compile your service, run it as a service. Then go to Delphi/BCB run 
  menu
  and select attach to
  processus (or similar designation: I have a french version). Then 
  select
  your service process.
 
  --
  [EMAIL PROTECTED]
  http://www.overbyte.be
 
  -- 
  To unsubscribe or change your settings for TWSocket mailing list
  please goto http://www.elists.org/mailman/listinfo/twsocket
  Visit our website at http://www.overbyte.be

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

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

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


Re: [twsocket] Fw: Sync THttpConnection derivative

2005-10-11 Thread Fastream Technologies
Hi,

I did the Attach process trick. It is very weird that the bug now does not 
occur when I go line-by-line in the debugger but occurs when I hit F9. :(( I 
will continue tomorrow...

Thank you!

SZ

- Original Message - 
From: Francois Piette [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, October 11, 2005 5:20 PM
Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 Whare you able to debug your service as I described ?
 If yes, single step thru your code until you find where the bug is.
 As Arno suggested, MadExcept is a really excellent product. I use it in 
 almost all my applications.

 --
 [EMAIL PROTECTED]
 http://www.overbyte.be

 - Original Message - 
 From: Fastream Technologies [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Tuesday, October 11, 2005 4:10 PM
 Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 Thanks for your replies (Francois and Arno).

 I tried to log with CodeGuard and EurekaLog and both failed (CodeGuard 
 app
 did not start as a service and EurelaLog did not trigger when Windows
 complained). I saw the following error on the Event Viewer:

 Faulting application NetFileServerEngine.exe, version 7.9.0.1199, 
 faulting
 module unknown, version 0.0.0.0, fault address 0x01d4e195.

 Regards,

 SZ

 - Original Message - 
 From: Francois Piette [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Tuesday, October 11, 2005 4:26 PM
 Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


  The problem maybe in kernel32 because you pass an invalid argument 
  value
  to an API function. Try to
  find what kernel32 function is called and from where in your program.
 
  --
  [EMAIL PROTECTED]
  http://www.overbyte.be
 
 
  - Original Message - 
  From: Fastream Technologies [EMAIL PROTECTED]
  To: ICS support mailing twsocket@elists.org
  Sent: Tuesday, October 11, 2005 3:04 PM
  Subject: Re: [twsocket] Fw: Sync THttpConnection derivative
 
 
  The problem seems to be in kernel32.dll. Could it be related to the
  NexusMM
  that we are only using with the service? It is still strange because 
  the
  error is given before quiting, ISAPI code is run...
 
  Best Regards,
 
  SubZ
 
  - Original Message - 
  From: Francois Piette [EMAIL PROTECTED]
  To: ICS support mailing twsocket@elists.org
  Sent: Tuesday, October 11, 2005 3:08 PM
  Subject: Re: [twsocket] Fw: Sync THttpConnection derivative
 
 
   But the error does not happen when debugging. It only occurs in
   service
   mode
   which is not debuggable. That's the whole problem!
  
   You can debug services !
   Compile your service, run it as a service. Then go to Delphi/BCB run
   menu
   and select attach to
   processus (or similar designation: I have a french version). Then
   select
   your service process.
  
   --
   [EMAIL PROTECTED]
   http://www.overbyte.be
  
   -- 
   To unsubscribe or change your settings for TWSocket mailing list
   please goto http://www.elists.org/mailman/listinfo/twsocket
   Visit our website at http://www.overbyte.be
 
  -- 
  To unsubscribe or change your settings for TWSocket mailing list
  please goto http://www.elists.org/mailman/listinfo/twsocket
  Visit our website at http://www.overbyte.be
 
  -- 
  To unsubscribe or change your settings for TWSocket mailing list
  please goto http://www.elists.org/mailman/listinfo/twsocket
  Visit our website at http://www.overbyte.be

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

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


Re: [twsocket] Fw: Sync THttpConnection derivative

2005-10-10 Thread Francois Piette
 WSocket_ioctlsocket(HSocket, ???, lCount); // What should be the 
  parameters here?

If you want the number of byte available for reading: FIONREAD.
If you want to put the socket in blocking mode: FIONBIO 

You can find those values by looking in MSDN for the ioctlsocket description.

--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be


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


Re: [twsocket] Fw: Sync THttpConnection derivative

2005-10-10 Thread Francois PIETTE
 I still get garbage data with NO HTTP header.
 Any idea why?

No idea why. But did you use the debugger to verify that Data and DataLen 
have correct values ?

To debug further, you can add an Windows.OutputDebugString in 
WSocket_Synchronized_send function to display what is really sent by the 
component, no matter if called normally by the component or by a direct 
call to WSocket_Send. To see messages printed out by OutputDebugString, you 
simply hit CTRL+ALT+V within Delphi (Probably the same with BCB).

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be




- Original Message - 
From: Fastream Technologies [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Monday, October 10, 2005 4:45 PM
Subject: Re: [twsocket] Fw: Sync THttpConnection derivative


 Hello and thanks for your replies,

 I now have the following code that do not raise any exception:

 In the connection class derived from TWebConnection:

Pause();

int iMode = 0;
WSocket_ioctlsocket(HSocket, FIONBIO, iMode);

if(!serverThread-DXISAPI-Execute(this,
ISAPIInterpreter,
Method,
Params,
Path,
LastFilePath,
RequestContentType, POSTString,
 postedDataLen, scriptResult))
result = dpError;
else
{
iMode = 1;
if(WSocket_ioctlsocket(HSocket, FIONBIO, iMode))
{
Resume();
Close();
}
else
Resume();
}

 and in the TWebConnection that is derived from THttpConnection and can be
 called from pascal DXISAPI code by callback functions:

OldDataAvailable := FOnDataAvailable;
OldSendData := FOnSendData;
OldDataSent := FOnDataSent;
FOnDataAvailable := nil;
FOnSendData := nil;
FOnDataSent := nil;

if FTerminated or
((State  wsConnected) and (State  wsSocksConnected)) then
begin
Result := false;
Exit;
end;

Count := WSocket_send(HSocket,
Data,
DataLen,
0);

Result := Count  0;
if Result = true then
DataSent := DataSent + Count;

if FTerminated or
((State  wsConnected) and (State  wsSocksConnected)) then
begin
Result := false;
end;

if Result = true then
begin
FOnDataAvailable := OldDataAvailable;
FOnSendData := OldSendData;
FOnDataSent := OldDataSent;
end;

 I still get garbage data with NO HTTP header.

 Any idea why?

 Best Regards,

 SubZ

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