Re: [twsocket] Has anybody built a BCB2010 project with ICSv7(latest)?

2009-09-16 Thread Arno Garrels
Fastream Technologies wrote:
 
 Where could I get more info on the proper way to do that?

Dunno for C++ Builder.
These articles address Delphi, however they are useful for 
C++ Builder users as well:
http://dn.codegear.com/print/38437
http://dn.codegear.com/print/38498
http://dn.codegear.com/print/38693

Basically, the System::String type now maps to UnicodeString in 2009
and later, UnicodeString is the default string type now, most of the 
VCL and RTL are Unicode, based on System::String, and the Win32 W-API
is called by default whereas the A-API was the default previously.
That is why you should not try to workaround Unicode, it would lead
to plenty of slow string casts with potential data loss. Note that
the Win32 W-API is much faster because Windows does not need to convert
strings back and forth internally.
Use AnsiString only if it needs to be strictly Ansi.
Once your application is fully migrated to Unicode you may disable 
directive STRINGCHECKS in OverbyteIcsDefs.inc which is ON by default
for C++ Builder.

Also keep in Mind:
Char = WideChar (two bytes now)
PChar = PWideChar

--
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] Has anybody built a BCB2010 project with ICSv7(latest)?

2009-09-16 Thread Fastream Technologies
Thanks for the summary and links! :-)

On Wed, Sep 16, 2009 at 10:08 AM, Arno Garrels arno.garr...@gmx.de wrote:

 Fastream Technologies wrote:
 
  Where could I get more info on the proper way to do that?

 Dunno for C++ Builder.
 These articles address Delphi, however they are useful for
 C++ Builder users as well:
 http://dn.codegear.com/print/38437
 http://dn.codegear.com/print/38498
 http://dn.codegear.com/print/38693

 Basically, the System::String type now maps to UnicodeString in 2009
 and later, UnicodeString is the default string type now, most of the
 VCL and RTL are Unicode, based on System::String, and the Win32 W-API
 is called by default whereas the A-API was the default previously.
 That is why you should not try to workaround Unicode, it would lead
 to plenty of slow string casts with potential data loss. Note that
 the Win32 W-API is much faster because Windows does not need to convert
 strings back and forth internally.
 Use AnsiString only if it needs to be strictly Ansi.
 Once your application is fully migrated to Unicode you may disable
 directive STRINGCHECKS in OverbyteIcsDefs.inc which is ON by default
 for C++ Builder.

 Also keep in Mind:
 Char = WideChar (two bytes now)
 PChar = PWideChar

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

--
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] Timeout in sync operations

2009-09-16 Thread Anton Sviridov
Hello!
I'm writing simple console downloader and decided to use sync operations in 
order to simplify structure. But I've found that sync requests (HttpCli) do not 
use any timeout, so they may last forever in case of error. My question is: how 
can I add timeouts without messageloops and threads and so on?

And second question, more global: Isn't it worth to add good and native timeout 
functionality to TWSocket so that thousands of developers hadn't invent a 
bicycle again and again? I know about TIcsTimer and so on, but it is not 'out 
of the box'.

-- 
Best regards, 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] Timeout in sync operations

2009-09-16 Thread Anton Sviridov
 how can I add timeouts without messageloops and threads and so on?
I see that there is still ControlSocket.MesagePump in SyncRequest, so I suppose 
creating timer will work, won't it?

-- 
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] Timeout in sync operations

2009-09-16 Thread francois . piette
 how can I add timeouts without messageloops and threads and so on?

You need a messageloop to make ICS component work anyway.
Every GUI application has a messageloop.
If you build a console mode application, you have to create one yourself. 
See various console mode ICS démos. Simple...

--
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] Timeout in sync operations

2009-09-16 Thread francois . piette

 And second question, more global: Isn't it worth to add good and native
 timeout functionality to TWSocket so that thousands of developers
 hadn't invent a bicycle again and again? I know about TIcsTimer
 and so on, but it is not 'out of the box'.

This is underway. but designing a general purpose timeout is not so simple 
because you potentially have thousands of components (server side). You 
can't create a TTimer for each one or you'll run out Windows resources very 
quickly (bad scalability).

Currently you should implement a timeout yourself. Using a single TTimer and 
carefully crafted code will do the job. Basically you need a list of all 
your timeout \jobs\ and have the timer event scan the list a do whatever 
appropriate is to evaluation and handle the timeout.
--
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] Timeout in sync operations

2009-09-16 Thread Anton Sviridov
If you build a console mode application, you have to create one yourself. 
See various console mode ICS d?mos. Simple...
Yes, I created TIcsTimer with HttpCli.CtrlSocket as Owner and implemented 
Start/StopTimer methods. Seems working, although I don't see yet how can I 
control the main function flow from OnTimer procedure (i.e., how to tell 
CtrlSocket that is's timeout).

This is underway. but designing a general purpose timeout is not so simple 
because you potentially have thousands of components (server side). You 
can't create a TTimer for each one or you'll run out Windows resources very 
quickly (bad scalability).
No problem, you could implement only one timer in the very root of socket (as 
you did with socket's window handle, AFAIR).

Currently you should implement a timeout yourself. Using a single TTimer and 
carefully crafted code will do the job
Yeah, and every developer should do the same, so we are inventing the bicycle 
again. Maybe then some general TTimeoutOperationsSeeker? Anyway, at least for 
connection stage timeouts should be implemented, imho.

-- 
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] Timeout in sync operations

2009-09-16 Thread Arno Garrels
Anton Sviridov wrote:
 If you build a console mode application, you have to create one
 yourself. See various console mode ICS d?mos. Simple...
 Yes, I created TIcsTimer with HttpCli.CtrlSocket as Owner and
 implemented Start/StopTimer methods. Seems working, although I don't
 see yet how can I control the main function flow from OnTimer
 procedure (i.e., how to tell CtrlSocket that is's timeout).

TWSocketCounter has been added to TWSocket in V7 with properties 
ConnectTick, ConnectDT, LastAliveTick, LastRecvTick and LastSendTick.
That makes it very easy to implement a custom timeout. 
Have a look at current THttpServer for an example.
   
 
 This is underway. but designing a general purpose timeout is not so
 simple because you potentially have thousands of components (server
 side). You can't create a TTimer for each one or you'll run out
 Windows resources very quickly (bad scalability).

 No problem, you could implement only one timer in the very root of
 socket (as you did with socket's window handle, AFAIR). 

If you have a better idea than TIcsThreadTimer, demo in the MiscDemos
folder, please let us know.   

--
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] Timeout in sync operations

2009-09-16 Thread Fastream Technologies
I think Arno and Francois is right about not making a TTimer per Thttpcli as
default. It would overwhelm our reverse proxy with 10k connections each with
two sockets. However for simple needs, Anton is right about asking for a
solution which I think sould only be switched on by a define.

Just my two cents,

SZ
On Wed, Sep 16, 2009 at 8:01 PM, Arno Garrels arno.garr...@gmx.de wrote:

 Anton Sviridov wrote:
  If you build a console mode application, you have to create one
  yourself. See various console mode ICS d?mos. Simple...
  Yes, I created TIcsTimer with HttpCli.CtrlSocket as Owner and
  implemented Start/StopTimer methods. Seems working, although I don't
  see yet how can I control the main function flow from OnTimer
  procedure (i.e., how to tell CtrlSocket that is's timeout).

 TWSocketCounter has been added to TWSocket in V7 with properties
 ConnectTick, ConnectDT, LastAliveTick, LastRecvTick and LastSendTick.
 That makes it very easy to implement a custom timeout.
 Have a look at current THttpServer for an example.

 
  This is underway. but designing a general purpose timeout is not so
  simple because you potentially have thousands of components (server
  side). You can't create a TTimer for each one or you'll run out
  Windows resources very quickly (bad scalability).

  No problem, you could implement only one timer in the very root of
  socket (as you did with socket's window handle, AFAIR).

 If you have a better idea than TIcsThreadTimer, demo in the MiscDemos
 folder, please let us know.

 --
 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] Timeout in sync operations

2009-09-16 Thread Arno Garrels
Anton Sviridov wrote:
 Hello!
 I'm writing simple console downloader and decided to use sync
 operations in order to simplify structure. But I've found that sync
 requests (HttpCli) do not use any timeout, so they may last forever
 in case of error. 

That's IMHO a bug.

--
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] Timeout in sync operations

2009-09-16 Thread Angus Robertson - Magenta Systems Ltd
  I'm writing simple console downloader and decided to use sync
  operations in order to simplify structure. But I've found that 
  sync requests (HttpCli) do not use any timeout, so they may last 
  forever in case of error. 
 
 That's IMHO a bug.

Indeed, poor implementation in THttpCli with no timeout.  

But most components do have a timeout for sync methods, for instance
TSyncSmtpCli and TFtpClient.  

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


[twsocket] Location of TTrafficLight component and example source code

2009-09-16 Thread Wayne Belshaw
Hello,

I'm trying to locate the source code and TTrafficLight component referenced
in an article written by Francois Piette and found originally in the
following inactive linkage: http://edn.embarcadero.com/print/20465.  It was
titled Writing Client/Server applications in ICS It would be of excellent
educational value. It also does not appear to be in the ICS suite according
to the listing.  Thanks in advance.

Wayne Belshaw
Brocade Communications
--
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