Re: [twsocket] Built-in timeout questions

2011-02-02 Thread Anton S.
Regarding accepted sockets: that's how I solved the problem for now:

procedure TServer.TriggerClientConnect(Client: TWSocketClient; Error: Word);
begin
  inherited;
  if Error  0 then Exit;
  with TSrvClient(Client) do
  begin
TimeoutSampling := 1000;
TimeoutConnect := InactiveTimeout;
TimeoutIdle := InactiveTimeout;
OnTimeout := ClientTimeout;
TimeoutStartSampling;
Counter.SetConnected; // -- init Counter manually
  end;
end;

This good method might be called in TimeoutStartSampling after Counter creation 
when state is wsConnected, and after socket accepting too.

-- 
Anton
--
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] Install ICS SSL Delphi 2007 Problem NO SSL

2011-02-02 Thread Francois PIETTE

I probably have another stupid question : How do you know
you have not SSL installed ?



I removed the USE_SSL to make it do the SSL not matter what then I get
ERRORS on all the TSSL* files undelcarded ident


USE_SSL is required in all projects using SSL and also in both packages 
(runtime and designtime).
When you add/remove the define, you MUST rebuild everything, packages and 
applications.


And of course you need to have the two OpenSSL DLL deployed.
--
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] Two things in ICS (probably bug/potential bug)

2011-02-02 Thread Francois PIETTE

The .NET code in V7 is unfinished work, it never compiled.



Unfinished work, sure. But it worked at some point. And from trhat point
changes have been made with no effort to keep it running because no one
seems interested anymore in a .NET version.



Ah, now things are clear. Very pity - lots of efforts in vain!


Yes indeed. I tought people would be interested in having their Delphi.NET 
application up and running quickly. It was not the case.



Delphi.Net seem to be unuseful thing at all though idea is great.


Delphi.NET is now Prism and it is not fully compatible with Delphi.Win32. 
it is almost impossible to have a single source code for both environment. 
Havong to source sets is really too much work for me to keep in sync. This 
was what I made with the Linux/Kylix version and I failed to update Kylix 
version each time Win32 version was updated. Anyway, Kylix was also a 
failure but will soon resurect as the next cross platform Delphi version ! 
It looks like ICS/Kylix could be reused quite easily.


--
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] Two things in ICS (probably bug/potential bug)

2011-02-02 Thread Fredrik Larsson
I was just wondering, creating a DLL in Delphi and use it as described in
http://wiki.overbyte.be/wiki/index.php/FAQ._Microsoft_.NET_framework
still works or?

Regards, Fredrik

-Original Message-
From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On
Behalf Of Francois PIETTE
Sent: den 2 februari 2011 11:52
To: ICS support mailing
Subject: Re: [twsocket] Two things in ICS (probably bug/potential bug)

The .NET code in V7 is unfinished work, it never compiled.

Unfinished work, sure. But it worked at some point. And from trhat point
changes have been made with no effort to keep it running because no one
seems interested anymore in a .NET version.

 Ah, now things are clear. Very pity - lots of efforts in vain!

Yes indeed. I tought people would be interested in having their Delphi.NET 
application up and running quickly. It was not the case.

 Delphi.Net seem to be unuseful thing at all though idea is great.

Delphi.NET is now Prism and it is not fully compatible with Delphi.Win32. 
it is almost impossible to have a single source code for both environment. 
Havong to source sets is really too much work for me to keep in sync. This 
was what I made with the Linux/Kylix version and I failed to update Kylix 
version each time Win32 version was updated. Anyway, Kylix was also a 
failure but will soon resurect as the next cross platform Delphi version ! 
It looks like ICS/Kylix could be reused quite easily.

--
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] Built-in timeout questions

2011-02-02 Thread Arno Garrels
Anton S. wrote:

 1) In my descendant class I implement true asynchronous Connect with
 asynchronous DNS lookup before connecting. 

Method DnsLookup doesn't require a custom timeout since the underlaying
winsock function uses system's DNS lookup timeout. Same for Connect
with or without DNS name.
And if method Connect is called with a DNS name it performs a blocking
DNS lookup while a Built-In timeout won't trigger at all. 

 Of course, I wish to use
 built-in timeout mechanism for tracking timeouts. But descendant
 classes haven't access to necessary fields, namely
 FTimeoutConnectStartTick. And without it I have no means of
 controlling the timeout.
 There are two ways as I see it: make
 FTimeoutConnectStartTick protected or even public - like Counter
 field is - or add a parameter to TimeoutStartSampling with type
 TTimeoutReason. Inside this method when parameter is torConnect,
 FTimeoutConnectStartTick would be assigned. Or, async DNS lookup
 before connect could be implemented in TWSocket what is the best
 decision IMHO :)

I don't see it. Why do you need FTimeoutConnectStartTick? 

You can do what ever you like i.e. (from memory): 

MyWSocket1.TimeoutConnect := 0;
MyWSocket1.TimeoutIdle := 15000;
MyWSocket1.TimeoutStartSampling;
MyWSocket1.InDnsLookup := TRUE;
MyWSocket1.DnsLookup;

[..]
procedure TForm1.MyWSocket1DnsLookupDone(Sender: TObject;
  ErrCode: Word);
begin
  MyWSocket1.InDnsLookup := FALSE; 
  MyWSocket1.TimeoutStopSampling;
  ..
  if ErrCode = 0 then 
  begin
  MyWSocket1.Addr   := MyWSocket1.DnsResult; //IP
  MyWSocket1.TimeoutIdle:= 0;
  MyWSocket1.TimeoutConnect := 3;
  MyWSocket1.Connect;
  end;
end;

procedure TForm1.MyWSocket1Timeout(Sender: TObject; Reason: TTimeoutReason);
begin
  if MyWSocket1.InDnsLookup then
  MyWSocket1.CancelDnsLookup
  else if Reason = torConnect then
..
  else
..;   
  ..
end;

Or simply use TimeoutIdle only and handle the timeout according
to whatsoever state you like. You may also call TimeoutStartSampling
from the timeout event handler.
   
 
 2) I have listening socket and wish to have its clients disconnected
 by inactivity timeout. Alas, the sockets created by Accept are never
 ininialized with timeout code. 

Listening sockets do not connect so use TimeoutIdle in OnClientCreate
event:

procedure TTcpSrvForm.WSocketServer1ClientCreate(Sender: TObject;
  Client: TWSocketClient);
begin
Client.TimeoutSampling := 5000;
Client.TimeoutIdle := 3;
Client.OnTimeout   := ClientTimeout;
end;

procedure TTcpSrvForm.ClientTimeout(Sender: TObject; Reason: TTimeoutReason);
begin
if TWSocketClient(Sender).State = wsConnected then
TWSocketClient(Sender).CloseDelayed;
end;

Or call TimeoutStartSampling explicitly from OnClientConnect.

 
 3) I have a TTimer in my thread which owns sockets. May I use
 TIcsThreadTimer instead and would it be more effective or no
 difference?  

TIcsThreadTimer is a lazy, low resolution timer, so in general no 
TTimer replacement, use TIcsTimer if you need a thread-safe TTimer
replacement. TIcsTimer doesn't create a hidden window but uses 
TWSocket's window to receive WM_TIMER messages, that saves
one window handle.

There are example apps. for both ICS timers in folder MiscDemos. 
 
-- 
Arno Garrels

 --
 Anton
--
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] Two things in ICS (probably bug/potential bug)

2011-02-02 Thread Francois PIETTE




I was just wondering, creating a DLL in Delphi and use it as described in
http://wiki.overbyte.be/wiki/index.php/FAQ._Microsoft_.NET_framework
still works or?


I guess it won't work anymore with current ICS-V7.

--
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] Built-in timeout questions

2011-02-02 Thread Anton S.
2Arno

Method DnsLookup doesn't require a custom timeout since the underlaying
winsock function uses system's DNS lookup timeout. Same for Connect
with or without DNS name.
And if method Connect is called with a DNS name it performs a blocking
DNS lookup while a Built-In timeout won't trigger at all. 
Yes, this is blocking DNS lookup which I want to avoid. And I dislike relying 
on OS timeouts, maybe it'll be 5 minutes long?

You can do what ever you like i.e. (from memory): 
Thanks! I'll examine the snipped you provided!

Listening sockets do not connect so use TimeoutIdle in OnClientCreate
event
Ah, the trick is not using connect timeout! I've got it.

TIcsThreadTimer is a lazy, low resolution timer, so in general no 
TTimer replacement, use TIcsTimer if you need a thread-safe TTimer
replacement. TIcsTimer doesn't create a hidden window but uses 
TWSocket's window to receive WM_TIMER messages, that saves
one window handle.
Well, I want this timer to execute periodical and not time-precise tasks so 
resolution of GMinIcsTimerResolution  : Longword = 100; is far than enough. And 
regarding TIcsTimer, would it work if there's no any TWSocket object created 
yet?

-- 
Anton
--
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] Built-in timeout questions

2011-02-02 Thread Angus Robertson - Magenta Systems Ltd
 Yes, this is blocking DNS lookup which I want to avoid. And I 
 dislike relying on OS timeouts, maybe it'll be 5 minutes long?

There is nothing you can do to speed-up or stop the DNS or connection
timeouts, they are specified in the registry.  Even if you abort the
component on a timer, you can not re-use the socket for another
connection until the original Windows timeouts expires.   

I suspect that only one DNS look-up is done at a time, and multiple
look-ups are queued, but this may be OS dependent, and I could be wrong.
Using dozens or hundreds of sockets gets around the OS timeout issues. 

The best you can do is ping the remote IP first, because ping can be
timed out in five seconds or something sensible.  But this not always
work across the public internet due to firewalls blocking ping. 

Angus

--
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] Built-in timeout questions

2011-02-02 Thread Arno Garrels
Anton S. wrote:
 2Arno
 
 Method DnsLookup doesn't require a custom timeout since the
 underlaying winsock function uses system's DNS lookup timeout. Same
 for Connect with or without DNS name.
 And if method Connect is called with a DNS name it performs a
 blocking DNS lookup while a Built-In timeout won't trigger at all.
 Yes, this is blocking DNS lookup which I want to avoid. 

Note that it won't work faster with many calls from different
instances since winsock internally serializes the lookups.
If you need parallel lookups you have to use multiple threads.
In the IPv6 branch I implemented something like that, little demo
exists as well.

 And I dislike
 relying on OS timeouts, maybe it'll be 5 minutes long? 

Most likely not, have a look here:
http://technet.microsoft.com/de-de/library/cc977482%28en-us%29.aspx

 
 You can do what ever you like i.e. (from memory):
 Thanks! I'll examine the snipped you provided!
 
 Listening sockets do not connect so use TimeoutIdle in OnClientCreate
 event
 Ah, the trick is not using connect timeout! I've got it.

Sorry, I meant that accepted sockets do not call Connect.

 And regarding TIcsTimer, would it work if there's no
 any TWSocket object created yet?   

No it requires an owner of type TIcsWndControl or descendant.

-- 
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] Install ICS SSL Delphi 2007 Problem NO SSL

2011-02-02 Thread Marc Hale
Any other suggestions. I tried everything I can think of

-Original Message-
From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On
Behalf Of Francois PIETTE
Sent: Tuesday, February 01, 2011 3:08 PM
To: ICS support mailing
Subject: Re: [twsocket] Install ICS SSL Delphi 2007 Problem NO SSL

I probably have another stupid question : How do you know you have not SSL
installed ?
Make sur you have only one OverbyteIcsD2007Run.bpl and one
OverbyteIcsD2007Design.bpl  file anywhere on your harddisk. You may also
delete every file OverbyteIcs*.dcu anywhere on you harddisk.

--
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: Marc Hale firedude...@att.net
To: 'ICS support mailing' twsocket@elists.org
Sent: Tuesday, February 01, 2011 12:33 PM
Subject: Re: [twsocket] Install ICS SSL Delphi 2007 Problem NO SSL


 It is version 7 I even re-download it from the site to make sure I had the
 latest version. If I install the same code on one of my machines its fine.
 But on my new machine it won't install the SSL.

 I even copied all the registry settings from my old machine for Delphi
 2007

 I even copied the same info to my Delphi 2010 install and it installs the
 SSL fine.

 Is there some setting in Delphi 2007 I'm missing

 -Original Message-
 From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On
 Behalf Of Francois PIETTE
 Sent: Tuesday, February 01, 2011 2:11 AM
 To: ICS support mailing
 Subject: Re: [twsocket] Install ICS SSL Delphi 2007 Problem NO SSL

 You installed ICS-V5  instead of V7 ?

 --
 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: Marc Hale firedude...@att.net
 To: twsocket@elists.org
 Sent: Tuesday, February 01, 2011 2:28 AM
 Subject: [twsocket] Install ICS SSL Delphi 2007 Problem NO SSL


 Just got a new PC and installed Delphi 2007 trying to install ICS SSL
 which i already have installed on my 2 other machines working fine.

 not matter what i do when i build and install the 2007 group it will not
 install SSL. i have check the package and USE SSL is defined.

 i compiled it on a different computer and all fine. copied the code back
 to my new computer and compiled it and ssl will not install

 Please help.

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

--
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] Error with SSLWSocketClient

2011-02-02 Thread daniel cc
Hello,
I have received an error from my client on test,
the error is,
“Revocation information for the security certificate for this site is not 
available, do you want to proceed?”

Please notice,
I am using the demo/test certificates delicered with ICS component package 
because I am still doing a test period.
I just would like to know if someone else has the problem and what is the 
solution?

Thanks
--
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] Install ICS SSL Delphi 2007 Problem NO SSL

2011-02-02 Thread Francois PIETTE

Any other suggestions. I tried everything I can think of


Restart everuthing from scratch.
First remove all files related to ICS from your harddisk, everywhere on your 
hard disk, including pas, dpr, dfm, dsk, cfg, res, dcu, dcp, and bpl files. 
Remove ICS packages from the IDE (components / install component / packages 
and REMOVE all ICS packages you can find).
Then use Tortoise or any other subversion client to download the latest 
ICS-V7 from the version control system repository at 
svn://svn.overbyte.be/ics/trunk or http://svn.overbyte.be:8443/svn/ics/trunk 
(usercode and paswword are both ics).
Then start Delphi, and open 
installdir/ics/trunk/install/D2007Install.grouproj. Rebuild the runtime 
package, rebuild the design time package, install the design time package. 
Add installdir/ics/trunk/delphi/vc32 directory to Delphi search path (in 
the IDE options).
Then open the sample projectgroup: 
installdir/ics/trunk/delphi/internet/OverbyteIcsD2007Sam.grouproj and 
rebuild all samples.

This has to work ! If not, reinstall Delphi 2007 and start again.

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