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, bu
>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.
Adam, you should read my recent message called "ICS in DLL. My report about
results" here in mail list.
I faced with tons of troubles because of DLL nature so finally I returned to my
own blocking socket classes (just a simple WinSock wrapper - fortunately I
needed only basic functions in DLL).
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 y
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 lik
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 unsubscr
>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 h
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 bl
>I think you should use only one
thread for all socket operation within your application and one thread for
each lengthy processing/computation you have to do. The rule is to avoid
lengthy processing within the thread doing communication.
Yes, that's exactly I intended to do except I don't need
>You get the best isolation from
>the host application by creating a worker thread and run most of your code
>in the context of this thread.
Okay, I think I got the structure which seems correct.
As I need several sockets for several purposes, I can't use socket's message
loop (I don't want to c
>I could leave the connection open without sending a response?
You may delay it for, say, 5 sec. But then I guess the vulnerability to DDOS
increases (thousands of connections simultaneously). I'm not sure how much of
them is possible.
>Or send a vast amount of rubbish data in response?
Maybe — i
2Arno:
>No problem to use async in a DLL, have a look at OverbyteIcsDll1 demo,
>it shows a multi-thread capable implementation. If you don't need MT
>have a look at the console demos, those with "con" in name, the same
>princple works in a DLL as well.
Thanks! I digged into OverbyteIcsDll1 demo an
Hmm, things appeared not so simple as they seemed. Assigning LastError on both
session connect and disconnect immediately rewrites connection error code with
0 caused by successful close. Currently I have no nice idea but maybe someone
has?
--
Anton
--
To unsubscribe or change your settings fo
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
beg
>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
>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 hug
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 ser
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 unsub
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
pleas
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 unacces
>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 XmlCtrlChars[
>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 u
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 for
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 longer'
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.
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 o
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 http://www.ove
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
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 CheckLogOptions(lo
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). DispatchMessage
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
>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 http://lists.elists.org/cgi-bi
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 http://lists.elists.org/cgi-bin/mailman/listinfo
>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 http://lists.elists.org/cgi-bin/mai
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 http://lists.elists.org/cgi-bin/mailman/listinfo/twsocke
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 http://www.overbyt
>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 se
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 http
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 http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
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
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;
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
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 stil
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
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 "FClientList.Remove(AComponent
>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 n
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 thi
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 http://lists.elists.org/cgi-bin/mailma
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
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
>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
-
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 st
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 to
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 := TIcsTimer.Create(Self);
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: Native(U)In
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 t
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
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
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 unsubsc
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 http://lists.elists.
>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
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
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
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 hug
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 D
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' Ma
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 location
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 k
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 201
>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
>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
Visi
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 strin
TIcsLogger.DoDebugLog uses non-optimal algorithm dealing with timestamps: it is
being added to Msg three times.
I suggest change the code as following:
procedure TIcsLogger.DoDebugLog(
Sender : TObject;
LogOption : TLogOption;
Msg : String); // remove const to avoid declarin
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 asynchronous
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
82 matches
Mail list logo