Hello all,
I experienced a situation when TWSocket's handlers confuse application workflow.
I have SessionConnected handler async-ly reporting an error and SessionClosed
handler async-ly reconnecting/pausing/reporting an error - depends of several
conditions.
Everything worked fine for months,
I have an existing DLL that was written to use TClientSocket via a data
module. It has a kind of message pump but it works in reverse... it has a
timer thread that uses postmessage to trigger the main app to call a
ReadData function which checks the socket for received data, then processes it.
I think it's not the proper place for this subject but I see no problem here:
take the sources and modify them as you wish, it's OpenSource! I'd also remove
all TNT stuff because it became useless since D2009 but maybe backward
compatibility must be kept.
--
Anton
--
To unsubscribe or change
Guys, I know most of you are fond of newsgroups and all that stuff, but no one
tells you to stop using them. The resource I've found provides an additional
forum-like interface for the maillist, with no efforts for the admins excepting
first-time registration. You may continue using what you
I just found a nice thing at http://www.nabble.com/. It provides forum-like
interface based on the mailing list. I find it much more useful than mail
archives especially if you want to read complete conversation. Would be awesome
if ICS list is accessible via this site.
--
Anton
--
To
Why don't you use initialization/finalization sections?
Do you really think that these sections are executed not from DLLMain?
--
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
After 1.5 days of struggling with DLL and async model I decided to share some
experience.
What I needed is DLL with several functions interacting via sockets with a
remote app. They must send request messages, receive responces, process them
and return as out parameters. Function call must be
I now trying to implement sync socket actions (I'll need to make DLL so async
model doesn't fit).
procedure TSockClient.Request;
begin
if State wsConnected then
begin
Connect;
while not (State in [wsConnected, wsClosed]) do
MessagePump;
if State wsConnected then
begin
In OverbyteIcsWSocketS unit, TCustomWSocketServer.TriggerSessionAvailable
method, Client.FCliId is determined as incremental counter. But as this counter
is resetted after $7F, it is possible that some client IDs are duplicated.
Of course it would be a very rare case but it could lead to
It is only guaranteed that _connected clients never share the same CliId.
I couldn't see _where_ it is guaranteed... It's quite possible to have 1st
client with ID 1 connected for a long, long time while others connect and
disconnect very frequently (i.e. large proxy and a client downloading
Let's do some computation: the ID wrap around after 2.147.483.647
connections. If you have 100 connections/disconnections per second, then it
will take 248 days to wrap around.
Well,
if FClientNum = $7F then
currently it wraps around after 8,388,607 what is very little and might be
That Bomb trick causes some troubles like Code insight failure or something
else - I don't remember exactly, but I experienced one. Actually it could be
replaced by {$MESSAGE FATAL 'Wrong defines'} undestandable by new compilers,
and old compilers would stop on it anyway.
--
Anton
--
To
Hello all, I have a small request for timeout socket.
By Arno's advice writing to this list.
I recently faced with necessity of tracking ticks inside a socket (actually I
want to pause it for some time and then resume). As I use BUILTIN_TIMEOUT, I
tried to attach to TimeoutTimer but it's
Arno, thanks for the tip, I'll give it a try.
P.S. I noticed right now that there are useless things in
TCustomWSocket.WMASyncSelect : TTTCount constant and FSelectMessage field. They
probably should be removed.
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
Delphi HTTPApp unit, function HTMLDecode
Wow! I had no idea of this unit, Thanks a lot! HTTP date parsing, Cookies (!),
entuity en/decoding... THttpCli might take some useful code from this unit :)
But as I see, HTMLEncode touches only special chars. If that's what you need,
fine. You may also
You may also use my function which I wrote for a XML:
Ahh, sorry, you need decoding... here's algorythm:
1) Search for
2) Search for ; after
3) Get text between and ; as S
4) idx := AnsiIndexStr(S, XmlEntities);
if idx = -1 then ... // Error or ignore
5) replacement char is
Hello Francois, thanks for answering.
2) $IF defines
for my units, I replaced the include file with COMPILER_##_UP defines to the
file with following text:
// compiler version constants for checking with $IF directive (only for
Delphi7+)
const
RAD_XE = 22;
RAD_2010 = 21;
RAD_2009 = 20;
ICS guys, I humbly ask you to pay attention on my previous message.
--
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
Daniele, great! Built-in coookie manager would be a great improvement!
Looked quickly at your unit. You have many code in StringToCookie that formats
date, but OverbyteIcsHttpProt.pas already has functions RFC1123_Date and
RFC1123_StrToDate
--
Anton
--
To unsubscribe or change your settings
I'm now working with HttpCli and after examining OverbyteIcsHttpProt unit I
have several suggestions
1) Excess ancient defines
While only D7+ is supported currently in ICS7, there are some legacy defines:
{$IFNDEF COMPILER7_UP}
'Sorry, we do not want to support ancient compilers any
Angus
Only if your ICS project needs to access more than 2 gigs of memory (or
is it 4), or is a DLL called by other 64-bit applications.
Well, native apps get more efficiency anyway.
ICS is currently being tested for 64-bit computability, which
unfortunately means replacing 32-bit assembler.
I
Finally, it's here!
http://www.embarcadero.com/products/delphi/64-bit
Maybe it's time to check all our projects for 64-bit compatibility? :)
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit
Just FYI
Twitter tells third-party devs to stop making Twitter client apps
In a statement issued today by Twitter on its official developer mailing list,
the company informed third-party developers that they should no longer attempt
to build conventional Twitter client applications. In a move
IMHO such operations as Abort should be as much quiet as possible. Nobody cares
the results, they just must work.
--
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
Nice! Thanks Arno :)
--
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
Would be nice if there would be debug log messages when creating (and maybe
accepting) sockets (including pointer and socket handle like in ... will be
connected to message). It will help to track main stages of socket life.
I added these lines
{$IFNDEF NO_DEBUG_LOG}
if
Albert, do you really need multithreadness with ICS? It's asynchronous so you
just need one additional thread that will launch and control all sockets.
And regarding the leaks, consider using FastMM4 in full debug mode to get more
info (i.e. type of variable that has been leaked).
3proxy developer answered (translation is mine)
What vesion was used? 0.7 has quite many fixes for HTTP/1.1 to work but old
vesions are transferring 1.1 as 1.1 as well. Let them log request/replies or
smth like that
Arno maybe you'll wish to contact 3APA3A personally? I've little idea of HTTP
var
lBuffer:array[0..1500] of AnsiChar;
I'd advice you not to allocate static buffer inside a method because it is
placed inside the stack every time method is called.
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto
TWebbrowser? ShellExec?? Chromium?? Why don't you use ICS HTTPCli for
authorizing? You may even display an original page with powerful ThtmlViewer
component.
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto
There's already a method through httpcli, but PIN approach should always be
encouraged.
I don't know what PIN is but couldn't it be implemented without external
apps/activeX?
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto
Arno, I'll post a message to the 3proxy's forum and give a link to this thread
so that 3APA3A could be aware.
--
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
I think another maillist would be fine bacause you won't have to maintain an
actual list of people interested in notifications.
RSS would be good too.
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto
Is there some switch to turn that on?
I just tried briefly yesterday and it returned HTTP/1.0
responses to my HTTP/1.1 request.
Don't know, it should simply work! Are you sure to use latest version?
I now tried to test with Opera with option Use HTTP 1.1 for proxies enabled
but it used to send
Arno,
18/02/2009 3[APA3A]tiny proxy 0.6
New features since 0.5 are marked with !.
Features:
1. General
+ HTTP/1.1 Proxy with keep-alive client and server support,
transparent proxy support.
http://3proxy.ru/0.6.1/Release.notes.txt
and this software is unlikely a trojan. I
however with socks #20xxx is not a winsock error
is displayed everywhere with socks errors
What's the problem? ICS uses custom WSocketErrorDesc anyway so just add a
definition of socks errors there.
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto
Thanks Arno, I followed your advices and successfully solved both issues.
Regarding timer I'll try ThreadTimer as I don't need precise resolution here
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto
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;
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
I just downloaded recent version from SVN and found a strange define in
OverbyteIcsDefs.inc
{$IFDEF CLR}
{$DEFINE BOMB}
{$ELSE}
{$IFNDEF COMPILER7_UP}
{$DEFINE BOMB}
{$ENDIF}
{$ENDIF}
It seems that it shouldn't really be CLR but old versions of BCB or something
else.
And the second
It's not for .NET however for Delphi 7+ and BCB 2006+, what is the
problem?
Do you mean that ICS currently couldn't be compiled under .NET?
FHSocket actually is of type TSocket = u_int = Integer defined in
Winsock.pas, WPARAM and LPARAM are of type Integer defined in
Windows.pas, there is no
I faced strange issue when connected clients seem not to be removed from
server's list on disconnect.
I wrote simple demo project to test this, it'll be later. In short words,
client objects seem to never be deleted from FClientList. I've set breakpoint
on the line
Tobias, oh, thanks a lot! Today is the day when I use to forget to call
ancestors' methods :)
--
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
Hello all,
recently I've started migrating from my own timeout-featured TWSocket
descendant towards the ICS built-in timeout. First of all, thanks to Arno for
implementing this feature!
Usage is quite simple and most of the questions could be answered by reading
the code but some things are
Arno wrote:
The .NET code in V7 is unfinished work, it never compiled.
Francois wrote:
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
2Bruno:
Could you guide me to do the modification please ? and where ?
it would be really nice from you.
Well, I'm not an expert in ICS and have little knowledge of HttpCli but here's
dummy vision of the issue.
Search inside OverbyteIcsFtpCli.pas for BUILTIN_THROTTLE and copy-paste all
the stuff
Is it possible that the FTP transactions can, for whatever network reasons,
hog the CPU resources so that my application cannot get access to the USB
data?
Is it possible to completely turn off all FTP exchanges and try only with USB?
You may also check CPU usage during FTP sessions.
--
Anton
2Angus
The old bandwith control code is unused, indeed not compiled, so removing
it does not break existing applications. But there is no point in
rewriting it which is what you were suggesting.
I don't think so. OverbyteIcsDefs.inc has BUILTIN_TIMEOUT BUILTIN_THROTTLE
defines commented by
Maybe you'd try to extract USB interaction into separate thread and assign to
it a higher priority?
--
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
Angus, Arno, thanks for info about threads in ICS! I'll probably take a look at
built-in timeouts and use them instead of my own ones which I implemented by
TIcsTimer.
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto
Arno, in FtpCli unit there's quite large piece of code
{$IFDEF UseBandwidthControl}
FBandwidthCount := 0; // Reset byte counter
if ftpBandwidthControl in FOptions then begin
if not Assigned(FBandwidthTimer) then
FBandwidthTimer :=
RTT:
Why you insist in use SSL if the client and server applications are
coded by you?!! Why use a standard that only exist because of the need
to connect many different implementations of clients to many different
implementations of servers?
It's easy to implement encryption but you'll have
I recently reviewed all my projects to be ready to x64 (replaced things like
Integer(Pointer) ) and also checked code of some components I use.
The main idea is not to cast pointers/handles to integer/cardinal as they may
exceed 4 bytes on x64 systems. Emb-ro introduced two new types:
Francois wrote:
Actually, there is an ICS version for Linux :-)
Thanks! I downloaded it and examined. So, it's thread-based actually - not
event-driven. You will still have a lot of work to port ICS provided that async
model would stay for *nix :)
Any Vista or Windows 7 has IPv6 installed. You
Angus wrote:
So the SNTP component is already testing with ICS for IPv6?
And with Delphi for Mac and Linux?
I'm afraid I hadn't got your point. Especially concerning Delphi for Mac and
Linux. There is still neither Delphi nor ICS for Mac/Linux (and porting ICS
may be a greatly complicated
Francois wrote:
The problem is not that I don't want to expand ICS. The problem is to
support ICS. There are a lot of interesting components that could be added
to ICS. By moving it into usermade page, I'm not commited to support it.
If included in ICS distribution, it has to be supported and
Hello all,
I just completed a TSNTPCli class which performs time-sync with NTP servers. I
guess it might be included into standard ICS toolkit. What do you think, is
someone interested?
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto
There are useless lines in OverbyteIcsFingCli and OverbyteIcsPop3Prot. Abort
procedures act like this
procedure TFingerCli.Abort;
begin
FWSocket.CancelDnsLookup; // this line is doubled
FWSocket.Abort;
end;
while CancelDnsLookup is included into TWSocket.Abort.
--
Anton
--
To
Angus wrote:
I did SNTP client and server 10 years ago, they are improved versions of
code from the usermade page:
Ahhh what a trouble! Why I hadn't know that!
Anyway I like my implementation more :)
Francois wrote:
Do you want an entry on the user made web page at ICS website ?
Well, if you
One OT question: Would it be faster if we use the cat() method of AnsiString
instead of the + operand?
It would be faster for you to check it yourself. I have no idea with BCB but on
Delphi + operator is counted to be faster than Append().
--
Anton
--
To unsubscribe or change your settings for
I dared to start the discussion in a separate thread.
I have seen a bottleneck in ICS with tens of thousands of clients: When a
client is disconnected the TWSocketServer calls FClientList-IndexOf() for
finding the index to remove the object! IndexOf is simply exhaustive search
and it is a huge
Fastream Technologies wrote:
clientString := IntToStr(ULong(Client))
Won't it be much faster to use TList with custom Compare method which would
compare Client pointers as integers? String comparison is a waste.
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please
Arno wrote:
I don't think so, why should it?
Well, the connection to HTTP client is closed when response is sent (usually;
there are some options in the request header to keep it but these cases are
rarer).
I'm just supposing, not asserting.
--
Anton
--
To unsubscribe or change your settings
The thing that ICS would sometimes become multi-platform is great! I myself
have quite little knowledge of what things are on *nix but I found an article
that seems like a good start. It describes several approaches to doing async on
*nix. I think it would be easier to use one of these and keep
Probably breaking changes could be iontroduced the day ICS stops supporting
non unicode compiler.
Probably ICS-V8 could be that one, maybe to be released at the same time as
Delphi crossplatfom, abandonning support for most of old Delphi version. I'm
thinking about letting ICS-V7 live for
Hello SZ!
You must parse the HTML for this. We use a Delphi HTML parser which I
downloaded from sourceforge for this but sometimes it raises an exception.
Search for that and if you cannot find it I will do my best to search it for
you in our projects...
Actually I'm trying to extend Angus'
Francois wrote:
In HTTP world, there is no real directory concept. There are only documents.
It happens that some webservers, if configured so could display a directory
content if the default document is missing. That directory content is a HTML
page built automatically by the webserver.
Yes,
Currently I'm starting some research on HTTP downloads with ICS THttpCli. I
want to add recursive download functionality but faced with impossibility to
distinguish file of directory. Then I noticed that requests to folder without
trailing slash (GET /somepath/foo/bar) are redirected to
As for me, I counted current compilers.inc code not-optimal too so I redesigned
it. Haven't tested it with .Net or Linux (these targets use quite different
approach) but Windows versions seem working OK.
Here's my version:
// Compiler defines not specific to a particlular platform.
// BDS
In addition to previous message: Jon's suggestion with {$IF CompilerVersion =
##} looks pretty, and if the only thing preventing from using it is a new
compiler versions, it could be easily solved by this code:
{$IF CompilerVersion LastKnownAndTestedCompilerVersion}
Error ( Sorry, I don't
Note that the old icsv7 branch doesn't get any more
updates, updates go to the trunk from now.
What's the difference between old and new v7 ?
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit
I suggest you read the change log with a SVN client,
I've read it just now, and all it said was about XE support :)
I'll seek changes with WinMerge.
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Arno,
I do not think that people use multiple log destinations at the
same time. Currently the string is allocated and concatenated
only when actually required.
But it's possible. My modification is more compact also.
This is non-optimal as well.
You always concatenate and allocate the string
Eric, talking about your shared timer: do you call OnTimer of all attached
objects directly or post WM_TIMER to them? I had though over the same timer
class and that was my idea to broadcast timer signal. I think it'll eliminate
the issue of blocking during loop since PostMessage is
Subj
--
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
75 matches
Mail list logo