Re: [twsocket] Handling redirects

2006-09-04 Thread Francois Piette
 Source code is the best help file you can get, it even
 describes the bugs ;-)

:-

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] NNTP Post failing to download

2006-09-04 Thread Eric Fortier
Hi all! 

It's been years since I posted on the list! Yep, I have come across a
problem ;) This is a weird one; I hope some of the gurus here can help. And
I do apologize for the length of this message!

Over the years I received a few reports from users using my newsreader
reporting that while downloading certain posts the download would suddenly
stop. No crash, just nothing happening anymore.

These reports have been rare but a couple date back to as early as 2000. I
initially attributed them to a bad connection or to a glitch of some kind on
the user machine, but a user wrote last week with this same problem again.

After a bit of investigating (and arm twisting!), I was able to get the
MessageID to one of the post that caused the newsreader to stop. To my
surprise, my newsreader *does* stop on that post on my very own computer!

I decided to try and find the cause of this and I downloaded the latest
version of ICS from Francois' site to investigate. Guess what? The post also
causes the demo Newsreader in the ICS distribution to stop! So the problem
is not my app after all.

I then tried the demo newsreader on three other computers on my network and
none of them had any problems downloading the post to completion on numerous
tries. Only my computer seems to be affected.

Next, I tried to download that same post using Outlook Express on my
computer. I'm pretty puzzled because it had no problem downloading it.

Going on, I tried this: downloading the post using BodyByID instead of
ArticleByID in the demo newsreader and it worked! I can repeat this behavior
at will, using ArticleByID it doesn't complete, and using BodyByID the posts
get completely downloaded.

With ArticleByID the demo newsreader stops at exactly the same place each
time, the last line received is #1975 or a message having 1985 lines. The
last 10 lines never come in using ArticleByID.

I'm pretty much stuck here at the moment, because I have no idea on how to
proceed with my investigation. While I know the Nntp component very well
(having rewritten several part of it), the inner workings of the WSocket
component are a mystery to me. I have no idea what FD_READ and all the other
stuff stand for :(

Still, it does sound as if the last packet (in case of network problem) or
buffer (in case of WSocket/NntpCli problem) never come in and the nntp
component keep waiting. In fact, if I try to send the Quit command an
exception is raised because the state is not nntpReady.

Can anyone offer any help or suggestion? I've been at this non-stop since
last week and I can't think of anything else to do...

Many thanks...

Eric Fortier

PS: If anyone wants to check out the message, the MessageID is:
[EMAIL PROTECTED]. I apologize for the content (warez
newsgroup) but I have nothing else to work with.

PPS: I have no antivirus, firewall or antispyware installed on my machine
and I also tried to connect on many different ports to my news server
(Giganews).


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Solution to problem with THttpCli

2006-09-04 Thread Fastream Technologies
When I say abort, I mean the client hitting -SHIFT+- refresh too rapidly. 
This causes an exhausting case. It could also be a problem with 
THttpConnection as well. To cover all cases, I created two flags: 
clientError (for THttpCli's socket) and socketError (for THttpConnection's 
socket) and seems not bad now. You can check it out here:

http://www.fastream.com/iqreverseproxy.php.

Best Regards,

SZ


- Original Message - 
From: Francois Piette [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Monday, September 04, 2006 9:36 AM
Subject: Re: [twsocket] Solution to problem with THttpCli


: I set a flag in THttpCli:OnDocBegin and reset it in OnDocEnd. If it is 
not
:  reset in OnRequestDone, then there was an error. Simple, isn't it?
:
: Is Abort the error cause ?
: Just adding a flag doesn't change anything. What does the component in 
case
: of error ?
: It isn't clear to me that there is a bug in the component or just a bad
: logic in the way you use the component.
:
: Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
: --
: [EMAIL PROTECTED]
: Author of ICS (Internet Component Suite, freeware)
: Author of MidWare (Multi-tier framework, freeware)
: http://www.overbyte.be
:
:
: -- 
: To unsubscribe or change your settings for TWSocket mailing list
: please goto http://www.elists.org/mailman/listinfo/twsocket
: Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Solution to problem with THttpCli

2006-09-04 Thread Francois Piette
What you tell me doesn't encourage me to do any code change.
If you really think it is a bug in the component, prepare a sample program
showing the problem. Si my previous message about this matter.

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

- Original Message - 
From: Fastream Technologies [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Monday, September 04, 2006 11:43 AM
Subject: Re: [twsocket] Solution to problem with THttpCli


 When I say abort, I mean the client hitting -SHIFT+- refresh too rapidly.
 This causes an exhausting case. It could also be a problem with
 THttpConnection as well. To cover all cases, I created two flags:
 clientError (for THttpCli's socket) and socketError (for THttpConnection's
 socket) and seems not bad now. You can check it out here:

 http://www.fastream.com/iqreverseproxy.php.

 Best Regards,

 SZ


 - Original Message - 
 From: Francois Piette [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Monday, September 04, 2006 9:36 AM
 Subject: Re: [twsocket] Solution to problem with THttpCli


 : I set a flag in THttpCli:OnDocBegin and reset it in OnDocEnd. If it is
 not
 :  reset in OnRequestDone, then there was an error. Simple, isn't it?
 :
 : Is Abort the error cause ?
 : Just adding a flag doesn't change anything. What does the component in
 case
 : of error ?
 : It isn't clear to me that there is a bug in the component or just a bad
 : logic in the way you use the component.
 :
 : Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
 : --
 : [EMAIL PROTECTED]
 : Author of ICS (Internet Component Suite, freeware)
 : Author of MidWare (Multi-tier framework, freeware)
 : http://www.overbyte.be
 :
 :
 : -- 
 : To unsubscribe or change your settings for TWSocket mailing list
 : please goto http://www.elists.org/mailman/listinfo/twsocket
 : Visit our website at http://www.overbyte.be

 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Handling my own windows messages

2006-09-04 Thread Lorenzo.Herrerias.external
Hello,
my application creates a new thread by client connection and these threads 
communicate by custom Windows messages with others threads.
Before, with ICS in the Execute() method i had:

//create the message queue
MSG msg;
PeekMessage(msg, NULL, 0, 0, PM_NOREMOVE);

   
PostThreadMessage(ThreadID,WM_NULL,0,0);
WaitMessage();

//etc.

socket-ProcessMessages(); //The quick message pump

Now, in the Execute() method i think there should be something like this 
(extracted from this article http://bcbjournal.com/free_issue/Mar04-01.htm):


//create the message queue
MSG msg;
PeekMessage(msg, NULL, 0, 0, PM_NOREMOVE);

   
PostThreadMessage(ThreadID,WM_NULL,0,0);
WaitMessage();

// the message pump
while (!Terminated  PeekMessage(msg, NULL, 0, 0, PM_REMOVE))
{
// break, if asked to quit
if (msg.message == WM_QUIT)
{
Terminate();
break;
}
// for window-specific messages
DispatchMessage(msg);
// for thread-specific messages
switch (msg.message)
{
//message handlers
}
}

Is this the correct method with ICS? I must overwrite MessagePump method or 
OnMessagePump event? 


Greetings
Lorenzo
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Handling my own windows messages

2006-09-04 Thread Francois Piette
Use the message pump which is built in TWSocket. There are several sample
program delivered with ICS which have their own message pump (for console
mode or for threads). Have a look at those.

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

- Original Message - 
From: [EMAIL PROTECTED]
To: twsocket@elists.org
Sent: Monday, September 04, 2006 3:01 PM
Subject: [twsocket] Handling my own windows messages


 Hello,
 my application creates a new thread by client connection and these threads
communicate by custom Windows messages with others threads.
 Before, with ICS in the Execute() method i had:

 //create the message queue
 MSG msg;
 PeekMessage(msg, NULL, 0, 0, PM_NOREMOVE);


 PostThreadMessage(ThreadID,WM_NULL,0,0);
 WaitMessage();

 //etc.

 socket-ProcessMessages(); //The quick message pump

 Now, in the Execute() method i think there should be something like this
(extracted from this article http://bcbjournal.com/free_issue/Mar04-01.htm):


 //create the message queue
 MSG msg;
 PeekMessage(msg, NULL, 0, 0, PM_NOREMOVE);


 PostThreadMessage(ThreadID,WM_NULL,0,0);
 WaitMessage();

 // the message pump
 while (!Terminated  PeekMessage(msg, NULL, 0, 0, PM_REMOVE))
 {
 // break, if asked to quit
 if (msg.message == WM_QUIT)
 {
 Terminate();
 break;
 }
 // for window-specific messages
 DispatchMessage(msg);
 // for thread-specific messages
 switch (msg.message)
 {
 //message handlers
 }
 }

 Is this the correct method with ICS? I must overwrite MessagePump method
or OnMessagePump event?


 Greetings
 Lorenzo
 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] NNTP Post failing to download

2006-09-04 Thread Francois PIETTE
 PS: If anyone wants to check out the message, the MessageID is:
 [EMAIL PROTECTED].

What is the group on that server.
It looks like I need a usercode password.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be



- Original Message - 
From: Eric Fortier [EMAIL PROTECTED]
To: twsocket@elists.org
Sent: Monday, September 04, 2006 9:00 AM
Subject: [twsocket] NNTP Post failing to download


 Hi all!

 It's been years since I posted on the list! Yep, I have come across a
 problem ;) This is a weird one; I hope some of the gurus here can help. 
 And
 I do apologize for the length of this message!

 Over the years I received a few reports from users using my newsreader
 reporting that while downloading certain posts the download would suddenly
 stop. No crash, just nothing happening anymore.

 These reports have been rare but a couple date back to as early as 2000. I
 initially attributed them to a bad connection or to a glitch of some kind 
 on
 the user machine, but a user wrote last week with this same problem again.

 After a bit of investigating (and arm twisting!), I was able to get the
 MessageID to one of the post that caused the newsreader to stop. To my
 surprise, my newsreader *does* stop on that post on my very own computer!

 I decided to try and find the cause of this and I downloaded the latest
 version of ICS from Francois' site to investigate. Guess what? The post 
 also
 causes the demo Newsreader in the ICS distribution to stop! So the problem
 is not my app after all.

 I then tried the demo newsreader on three other computers on my network 
 and
 none of them had any problems downloading the post to completion on 
 numerous
 tries. Only my computer seems to be affected.

 Next, I tried to download that same post using Outlook Express on my
 computer. I'm pretty puzzled because it had no problem downloading it.

 Going on, I tried this: downloading the post using BodyByID instead of
 ArticleByID in the demo newsreader and it worked! I can repeat this 
 behavior
 at will, using ArticleByID it doesn't complete, and using BodyByID the 
 posts
 get completely downloaded.

 With ArticleByID the demo newsreader stops at exactly the same place each
 time, the last line received is #1975 or a message having 1985 lines. The
 last 10 lines never come in using ArticleByID.

 I'm pretty much stuck here at the moment, because I have no idea on how to
 proceed with my investigation. While I know the Nntp component very well
 (having rewritten several part of it), the inner workings of the WSocket
 component are a mystery to me. I have no idea what FD_READ and all the 
 other
 stuff stand for :(

 Still, it does sound as if the last packet (in case of network problem) or
 buffer (in case of WSocket/NntpCli problem) never come in and the nntp
 component keep waiting. In fact, if I try to send the Quit command an
 exception is raised because the state is not nntpReady.

 Can anyone offer any help or suggestion? I've been at this non-stop since
 last week and I can't think of anything else to do...

 Many thanks...

 Eric Fortier

 PS: If anyone wants to check out the message, the MessageID is:
 [EMAIL PROTECTED]. I apologize for the content (warez
 newsgroup) but I have nothing else to work with.

 PPS: I have no antivirus, firewall or antispyware installed on my machine
 and I also tried to connect on many different ports to my news server
 (Giganews).


 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] About HTTP client V6 changes to support .NET

2006-09-04 Thread Maurizio Lotauro
Scrive Francois PIETTE [EMAIL PROTECTED]:

[...]

Generic speaking, I think that the introducing of an incompability is 
acceptable when:
- the application will not compile so the developer get the attention of the 
problem
- the changes needed are documented
- these changes are few and quick to apply.

About which one is better I have no idea, but I'm with Arno's opinion. I 
prefer the best solution for each platform. If the use of an array of byte 
will slow down the Win32 version then keep the use of pointer for Win32 and 
use the array in the .net version. This is important for components like ICS.

For a .net porting I don't think that a developer can expect to port the same 
application to a different platform without any changes. It is different if 
the developer want to keep it compatible with both platform, but I don't know 
if this make sence since both platforms working on Windows OS.


Bye, Maurizio.


This mail has been sent using Alpikom webmail system
http://www.alpikom.it

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] About HTTP client V6 changes to support .NET

2006-09-04 Thread Arno Garrels
Maurizio Lotauro wrote:
 I prefer the best solution for each platform. If the use of
 an array of byte will slow down the Win32 version then keep the use
 of pointer for Win32 and use the array in the .net version. This is
 important for components like ICS. 

I second that, I don't want to give up high speed of ICS Win32 just
to support .NET which I do not use (and will not use unless a customer
realy wants it). Any additional move of data in memory slows down
performance.

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


 
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] About HTTP client V6 changes to support .NET

2006-09-04 Thread Francois PIETTE
 I prefer the best solution for each platform. If the use of
 an array of byte will slow down the Win32 version then keep the use
 of pointer for Win32 and use the array in the .net version. This is
 important for components like ICS.

 I second that, I don't want to give up high speed of ICS Win32 just
 to support .NET which I do not use (and will not use unless a customer
 realy wants it). Any additional move of data in memory slows down
 performance.

Using a dynamic array of byte will not slow down the component if the array 
size is not constanly changed. Adressing an element in a fixed array or 
dynamic array roughly takes the same time. It is even a little bit faster 
(Tested with D7) to access the dynamic array !

procedure TestMe;
var
  DA : array of byte;
  SA : array [0..2047] of byte;
  B1 : Byte;
  B2 : Byte;
  I  : Integer;
  J  : Integer;
  t1, t2, t3 : Cardinal;
begin
  SetLength(DA, 2048);
  I  := 5;
  t1 := GetTickCount;
  for J := 0 to 1 do
  B1 := DA[I];
  t2 := GetTickCount;
  for J := 0 to 1 do
  B2 := SA[I];
  t3 := GetTickCount;
  writeln('Dynamic: ', t3 - t2, '  Static: ', t2 - t1);
  readln;
end;

You can play with optimization and range checking to see the impact of those 
options.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] About HTTP client V6 changes to support .NET

2006-09-04 Thread Angus Robertson - Magenta Systems Ltd
 Using a dynamic array of byte will not slow down the component if 
 the array size is not constanly changed.

And if the Move function is used to move data around, specifically when 
the project uses the FastMove unit which has very efficient move code.  

Mind Move uses pointers, so might be useless in .net, but that's a 
problem for people wanting to use .net, not win32. 

Angus
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] About HTTP client V6 changes to support .NET

2006-09-04 Thread Arno Garrels
Angus Robertson - Magenta Systems Ltd wrote:
 Mind Move uses pointers, so might be useless in .net, but that's a
 problem for people wanting to use .net, not win32.

If so, I'm happy again.

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] About HTTP client V6 changes to support .NET

2006-09-04 Thread Francois PIETTE
 Using a dynamic array of byte will not slow down the component if
 the array size is not constanly changed.

 And if the Move function is used to move data around, specifically when
 the project uses the FastMove unit which has very efficient move code.

That's not a problem. The code can be conditionaly compiled to use move or 
fastmove.
The problem is to have a class interface which is the same on both platforms 
so that an application code can be the same.

 Mind Move uses pointers, so might be useless in .net, but that's a
 problem for people wanting to use .net, not win32.

Indeed. Because .NET doesn't accept pointer, the code is frequently slower.
But again, this is not important and do not compromize win32 code. I restate 
it: the code inside the class can be changed using conditional compile, but 
not the class interface, specially the event handlers signature which mess 
all the forms.

I'm trying to have the best portable code to easily maintain a single set of 
components and samples. Take ICS for Kylix: the code has not been updated 
with all the changes in win32 code because it is different code. It is 
simply too time consuming to maintain both sets of source code.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] NNTP Post failing to download

2006-09-04 Thread Eric Fortier
Hi Francois,

  PS: If anyone wants to check out the message, the MessageID is:
  [EMAIL PROTECTED].
 
 What is the group on that server.
 It looks like I need a usercode password.

It's in the alt.binaries.warez.ibm-pc.ms-beta newsgroup. If you can't find
the post anywhere else, I can Email you my login info on Giganews so you can
try it. They also have a free 3 day trial with a 1 GB account on their site
at www.giganews.com.

Thanks!

Eric Fortier


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] About HTTP client V6 changes to support .NET

2006-09-04 Thread Maurizio Lotauro
Scrive Angus Robertson - Magenta Systems Ltd [EMAIL PROTECTED]:

[...]

 And if the Move function is used to move data around, specifically when 
 the project uses the FastMove unit which has very efficient move code.  

Small OT question: which FastMove do you use?


Bye, Maurizio.


This mail has been sent using Alpikom webmail system
http://www.alpikom.it

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] About HTTP client V6 changes to support .NET

2006-09-04 Thread Angus Robertson - Magenta Systems Ltd
 Small OT question: which FastMove do you use?

John O'Harrow's v3.03 Dec 2005.  It's 1600 lines of code, against the 14 
lines for the 'pure pascal' version, but is very efficient.  

Angus
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be