[twsocket] Connection Timeout

2010-10-11 Thread Olaf van der Meer
Hello,
 
Recently we have updated the ICS components and now we have some problems with 
the webserver.
In the old version every time a browser makes a request to the webserver a new 
connection were created and connected, and afterwards the connection were 
disconnected and destroyed. 
In the new version just one connection is created and connected (even if the 
browser makes several requests to the server). The connection will be reused 
untill it expires so much seconds as set by the property KeepAliveTimeSec of 
the webserver component. Only after the KeepAliveTimeSecs the connection is 
disconnect and the object will be destroyed. 
 
So the problem is: the old connection is reused and it contains data which 
could not belong to the request.
 
I have tried to set the KeepAliveTimeSec to zero which should disable the 
KeepAliveTime feature entirely (read from the svn-changelog), but then the 
connection still stays connected. It is even worse. Now it stays connected 
untill god knows how long. It is not predictable how long the connection is 
active.
 
I also tried to force the connection to close with the procedures Close en 
CloseDelayed after the answer is send. But then the answer is not send 
completely with half html pages as results.
 
Do you have any suggestions how to handle this?
 
Version of the webservercomponent before the update: THttpServerVersion = 142;
After: THttpServerVersion = 722;
And I use Delphi 2007.
 
Thanks in advance
 
Greetings,
Olaf van der Meer
;XSO xBase Software Ontwikkeling.
--
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] Connection Timeout

2010-10-11 Thread Arno Garrels
Olaf van der Meer wrote:
 Hello,
 
 Recently we have updated the ICS components and now we have some
 problems with the webserver. 
 In the old version every time a browser makes a request to the
 webserver a new connection were created and connected, and afterwards
 the connection were disconnected and destroyed.

It depends entirely on the client/browser. Only if it either uses 
HTTP 1.0 without the Connection: Keep-Alive header or = HTTP 1.1 with 
the Connection: close header the connection will be closed after each
request, that is how HTTP works. 
  
 In the new version just one connection is created and connected (even
 if the browser makes several requests to the server). 

See above, it has not changed. 

 The connection will be reused untill it expires so much seconds as set by the
 property KeepAliveTimeSec of the webserver component. Only after the
 KeepAliveTimeSecs the connection is disconnect and the object will be
 destroyed. 

Yes, you can turn this feature off by setting both KeepAliveTimeSec and
MaxRequestsKeepAlive to zero.

 
 So the problem is: the old connection is reused and it contains data
 which could not belong to the request.

Then it is your application that is buggy. 
 
 
 I have tried to set the KeepAliveTimeSec to zero which should disable
 the KeepAliveTime feature entirely (read from the svn-changelog), but
 then the connection still stays connected. It is even worse. Now it
 stays connected untill god knows how long. It is not predictable how
 long the connection is active.

Well, it's the same behaviour as in previous versions, there is no timeout 
specified, hence if a client requests a persistent connection it is not 
closed until the client disconnects or requests a connection close. 

 
 I also tried to force the connection to close with the procedures
 Close en CloseDelayed after the answer is send. But then the answer
 is not send completely with half html pages as results.  
 
 Do you have any suggestions how to handle this?

Set the MaxRequestsKeepAlive to 1 (one).
However your server application should be able to handle persistent
connections.

-- 
Arno Garrels
--
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] Connection Timeout

2010-10-11 Thread Francois PIETTE

now we have some problems with the webserver.
So the problem is: the old connection is reused and
it contains data which could not belong to the request.


What do you mean by it contains data ? The component handling a connection 
do not contain any data unless you added the data yourself and forgot to 
clear it at appropriate time.


Are you able to reproduce this behavious using the demo webserver provided 
with ICS ? If yes, please provide the exact steps so that we can examine it. 
If not, can youy write a very simple, actually the most simple possible, 
sample code showing the issue you have ?


Regards,
--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
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] Connection Timeout

2010-10-11 Thread Olaf van der Meer

Hello,

I use an own derived object of THttpConnection. In this object are some 
variables which are used for local processing.
The code has not been changed in years. I updated the ICS components and 
mentioned the differences in create and destroing of the THttpConnection 
object.


There were no clear actions. The application trusted on the creation of new 
objects when a new connection was made.
Now, I have added some clear actions and 'Connection: close' (for sure, if I 
forget to clear something) to the header of the answer.

It works well now.

Thanks for your help.

Regards,

Olaf van der Meer



- Original Message - 
From: Francois PIETTE francois.pie...@skynet.be

To: ICS support mailing twsocket@elists.org
Sent: Monday, October 11, 2010 10:42 AM
Subject: Re: [twsocket] Connection Timeout



now we have some problems with the webserver.
So the problem is: the old connection is reused and
it contains data which could not belong to the request.


What do you mean by it contains data ? The component handling a 
connection do not contain any data unless you added the data yourself and 
forgot to clear it at appropriate time.


Are you able to reproduce this behavious using the demo webserver provided 
with ICS ? If yes, please provide the exact steps so that we can examine 
it. If not, can youy write a very simple, actually the most simple 
possible, sample code showing the issue you have ?


Regards,
--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
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





--
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] Connection Timeout

2010-10-11 Thread Fastream Technologies
Hello,

Did you check whether FDocStream is cleared after request is complete?

Sometimes ICS version upgrades can lose backwards compatibility when
announced otherwise.

Regards,

SZ

On Mon, Oct 11, 2010 at 12:32 PM, Olaf van der Meer o.vanderm...@xso.nlwrote:

 Hello,

 I use an own derived object of THttpConnection. In this object are some
 variables which are used for local processing.
 The code has not been changed in years. I updated the ICS components and
 mentioned the differences in create and destroing of the THttpConnection
 object.

 There were no clear actions. The application trusted on the creation of new
 objects when a new connection was made.
 Now, I have added some clear actions and 'Connection: close' (for sure, if
 I forget to clear something) to the header of the answer.
 It works well now.

 Thanks for your help.

 Regards,

 Olaf van der Meer



 - Original Message - From: Francois PIETTE 
 francois.pie...@skynet.be
 To: ICS support mailing twsocket@elists.org
 Sent: Monday, October 11, 2010 10:42 AM
 Subject: Re: [twsocket] Connection Timeout



  now we have some problems with the webserver.
 So the problem is: the old connection is reused and
 it contains data which could not belong to the request.


 What do you mean by it contains data ? The component handling a
 connection do not contain any data unless you added the data yourself and
 forgot to clear it at appropriate time.

 Are you able to reproduce this behavious using the demo webserver provided
 with ICS ? If yes, please provide the exact steps so that we can examine it.
 If not, can youy write a very simple, actually the most simple possible,
 sample code showing the issue you have ?

 Regards,
 --
 francois.pie...@overbyte.be
 The author of the freeware multi-tier middleware MidWare
 The author of the freeware Internet Component Suite (ICS)
 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




 --
 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] Quality of Service?

2010-10-11 Thread Stefan Paege
Francois

 In a TWSocket you have access to the low level socket ahndle using
 TWSocket
 Handle property. You can issue winsock API function call using that
 handle.

So the following code should work!? 
WSocket_SetSockOpt does not throw an exception but returns -1. 
What kind of error is this? 
Any errors I would expect are in the 100xx or 110xx range.

procedure SetToS(aTWSocket: TWSocket; aToS: Byte);
var
  Len: Integer;
  Result: Integer;
begin
  try
Len := 1;
Result := WSocket_SetSockOpt(aTWSocket.Handle, IPPROTO_IP, IP_TOS,
@aToS, Len);
if Result = 0 then
  Log('ToS set')
else
  Log('ToS not set: Errorcode ' + IntToStr(Result));
  except
on E: Exception do
  Log('ToS not set: ' + E.Message);
  end;
end;



  Stefan Paege


elektronik-labor CARLS GmbH  Co. KG
Bergweg 6
48485 Neuenkirchen
GERMANY
Telefon: +49 (0) 5973 / 9497-23
Telefax: +49 (0) 5973 / 9497-19
E-Mail: pa...@el-carls.de
Internet: www.el-carls.de

Kommanditgesellschaft: Sitz Neuenkirchen, Registergericht Steinfurt HRA 3310

Persönlich haftende Gesellschafterin: elektronik-labor CARLS,
Beteiligungsgesellschaft mbH, Sitz Neuenkirchen, Registergericht Steinfurt
HRB 4175

Geschäftsführer: Irmgard Carls, Joachim Schulte, Helmut Schiffelholz



--
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] Quality of Service?

2010-10-11 Thread Francois PIETTE

You should call WSAGetLastError to know why the call fails.
Also you must be sure to call your function at a time that the Handle 
property is initialized.


By the way, in the description for IP_TOS, I read the following: Do not 
use. Type of Service (TOS) settings should only be set using the Quality of 
Service API. See Differentiated Services in the Quality of Service section 
of the Platform SDK for more information. 
http://msdn.microsoft.com/en-us/library/ms738586(VS.85).aspx


--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

- Original Message - 
From: Stefan Paege pa...@el-carls.de

To: 'ICS support mailing' twsocket@elists.org
Sent: Monday, October 11, 2010 1:22 PM
Subject: Re: [twsocket] Quality of Service?


Francois


In a TWSocket you have access to the low level socket ahndle using
TWSocket
Handle property. You can issue winsock API function call using that
handle.


So the following code should work!?
WSocket_SetSockOpt does not throw an exception but returns -1.
What kind of error is this?
Any errors I would expect are in the 100xx or 110xx range.

procedure SetToS(aTWSocket: TWSocket; aToS: Byte);
var
 Len: Integer;
 Result: Integer;
begin
 try
   Len := 1;
   Result := WSocket_SetSockOpt(aTWSocket.Handle, IPPROTO_IP, IP_TOS,
@aToS, Len);
   if Result = 0 then
 Log('ToS set')
   else
 Log('ToS not set: Errorcode ' + IntToStr(Result));
 except
   on E: Exception do
 Log('ToS not set: ' + E.Message);
 end;
end;



 Stefan Paege


elektronik-labor CARLS GmbH  Co. KG
Bergweg 6
48485 Neuenkirchen
GERMANY
Telefon: +49 (0) 5973 / 9497-23
Telefax: +49 (0) 5973 / 9497-19
E-Mail: pa...@el-carls.de
Internet: www.el-carls.de

Kommanditgesellschaft: Sitz Neuenkirchen, Registergericht Steinfurt HRA 3310

Persönlich haftende Gesellschafterin: elektronik-labor CARLS,
Beteiligungsgesellschaft mbH, Sitz Neuenkirchen, Registergericht Steinfurt
HRB 4175

Geschäftsführer: Irmgard Carls, Joachim Schulte, Helmut Schiffelholz



--
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


[twsocket] help on httpcli post

2010-10-11 Thread Xavier Mor-Mur

 Hello to all
I try to include http get and post to my program and doing tests on 
OverbyteIcshttptst demo.

I get function GET work but not with function POST.

I configured at home free HFS - HTTP File Server from 
http://www.rejetto.com/hfs/

When running demo I set
URL = http://81.184.21.22:100/hfs/c-obfuscado.txt
Data = C:\Mis documentos\c-obfuscado.txt
Button GET works and how text file in panel
Button POST give sequence events bellow.

Sure I missing to do something but I don't know what.
You can play with this HFS server ( http://81.184.21.22:100 ) as I have 
to work with some ones like this.


Thanks for any help
Xavi

Sequence of events for POST.


[HttpCli1StateChange]

[HttpCli1StateChange]

[HttpCli1StateChange]

[HttpCli1StateChange]

[HttpCli1StateChange]

[HttpCli1RequestHeaderBegin]

[HttpCli1Command]
POST /hfs/c-obfuscado.txt HTTP/1.0

[HttpCli1Command]
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

[HttpCli1Command]
Content-Type: application/x-www-form-urlencoded

[HttpCli1Command]
User-Agent: Mozilla/3.0 (compatible)

[HttpCli1Command]
Host: 192.168.2.2:100

[HttpCli1Command]
Content-Length: 33

[HttpCli1RequestHeaderEnd]

[HttpCli1Command]


[HttpCli1SendBegin]

[HttpCli1SendData]
33

[HttpCli1SendEnd]

[HttpCli1StateChange]

[HttpCli1StateChange]
POST Failed !
StatusCode   = 404
ReasonPhrase = Request aborted on timeout

[RequestDone Error]
8

--
Xavier Mor-Mur

--
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