Re: [twsocket] Conflicts between multiple instances

2009-07-16 Thread Francois Piette
 Is there a problem having multiple instances of ICS
 socket objects on the same thread?

Defenitely no problem.

The most frequent error when using ICS components in a thread is to forget
you must create the component from with the thread's execute method. If you
create the component from the thread's constructor, then all events will be
executed in the context of the creating thread (usually the main thread).
And this may cause a lot of trouble.
--
francois.pie...@overbyte.be
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://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Simple SMTP text emails rejected for virus or spam

2009-07-16 Thread Francois Piette
Hi Hoby,

 Specifically, the problem was that GoDaddy doesn't
 like parenthesis [( and )] in the from field.

Thanks for your feedback.
It is always good to know that the problem was not in ICS component.

--
francois.pie...@overbyte.be
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

- Original Message - 
From: Hoby Smith h...@romans618.org
To: 'ICS support mailing' twsocket@elists.org
Sent: Wednesday, July 15, 2009 10:47 PM
Subject: Re: [twsocket] Simple SMTP text emails rejected for virus or spam


 Well, I finally resolved this issue.  What a pain.  In the end, the
problem
 was just character data that GoDaddy didn't like.  It would have been nice
 if their SMTP  response had said something like, Invalid character data
 detected, instead of, Rejected due to spam or virus content.  But,
maybe
 I am asking too much?  ;)

 Specifically, the problem was that GoDaddy doesn't like parenthesis [(
and
 )] in the from field.  I was using parenthesis to designate the email
 address content from the friendly name, like, Some User
(u...@domain.com).
 I use that format so that users will see a more readable name in their
mail
 client (Outlook, etc).  Changing to brackets, like Some User
 u...@domain.com, fixed the problem.  Go figure.

 Historically, I have used both and never had a problem.  In this case, the
 SMTP profile was stored in an encrypted XML file for my service, so the

 was giving my problems in the beginning with the XML tags.  Hence, I used
 parenthesis instead.  Odd that GoDaddy didn't like it.  I have never had a
 problem with that format in the from field.  Oh well, like I said, a
more
 relevant message would have saved two days of my time, as well as their
 tech's time.

 BTW, I thought this was rather indicative of GoDaddy's persona.  Most
 servers I have had to log, respond to the SMTP data request with
something
 like, 354 Start mail input; end with CRLF.CRLF, or something
 informative like that.  However, GoDaddy's response is, 354 go ahead
punk,
 make my day.  Really.  Kind of tells ya something, huh?  :)

 Thanks for the input.  Hoby

 --
 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] [OT] Windows Internals Book 5th Edition

2009-07-16 Thread Francois Piette
Hi !

Sorry for slightly out of topic message, but this info could help you write
better programs using ICS.
Having a clear understanding how things are going under the cover always
help design better solutions.
Windows Internal Book will surely helps you. At least it helps me.
http://technet.microsoft.com/en-us/sysinternals/bb963901.aspx

Regards,
--
francois.pie...@overbyte.be
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://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] XMailer property

2009-07-16 Thread Arno Garrels
Francois Piette wrote:
 Regarding the hard coded boundary strings I suggest to
 make them (or parts) component properties.
 
 Would be a good idea to create a property XMailer with that string.
 The default value would be the current value. Some trick should be
 used so that the correct component version is used even if the
 property is serialized because the component has been dropped on a
 form. I think of a kind of placer holder such as %VER% within the
 string. 

I'm not sure what you mean by some trick. 
Do you mean a place holder as visible part of the default published 
string property, stored in dfm and replaced internally only when
headers are built?

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


[twsocket] [Fwd: Re: Conflicts between multiple instances]

2009-07-16 Thread Mike Lenox
In my current app, I only have a main thread. So, does this, ...this 
may cause a lot of trouble, apply?  I should expect trouble if I have 
multiple ICS components all executing on the main thread?


 Original Message 
Subject:Re: [twsocket] Conflicts between multiple instances
Date:   Thu, 16 Jul 2009 08:58:49 +0200
From:   Francois Piette francois.pie...@skynet.be
Reply-To:   ICS support mailing twsocket@elists.org
To: ICS support mailing twsocket@elists.org
References: 4a5e4805.5060...@ezriver.com




Is there a problem having multiple instances of ICS
socket objects on the same thread?


Defenitely no problem.

The most frequent error when using ICS components in a thread is to forget
you must create the component from with the thread's execute method. If you
create the component from the thread's constructor, then all events will be
executed in the context of the creating thread (usually the main thread).
And this may cause a lot of trouble.
--
francois.pie...@overbyte.be
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://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be



No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.375 / Virus Database: 270.13.16/2240 - Release Date: 07/15/09 
17:58:00

--
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] XMailer property

2009-07-16 Thread Francois Piette
 Francois Piette wrote:
  Regarding the hard coded boundary strings I suggest to
  make them (or parts) component properties.
 
  Would be a good idea to create a property XMailer with that string.
  The default value would be the current value. Some trick should be
  used so that the correct component version is used even if the
  property is serialized because the component has been dropped on a
  form. I think of a kind of placer holder such as %VER% within the
  string.

 I'm not sure what you mean by some trick.
 Do you mean a place holder as visible part of the default published
 string property, stored in dfm and replaced internally only when
 headers are built?

Yes, exactly. Sorry if trick was not the most appropriate word.
The property as seen in the object inspector would be something like ICS
SMTP component version %VER%. If the user want to include the % sign, he
has to double it like in My own component 100%% compatible with ICS version
%VER%.
--
francois.pie...@overbyte.be
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://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [Fwd: Re: Conflicts between multiple instances]

2009-07-16 Thread Francois Piette
  Is there a problem having multiple instances of ICS
  socket objects on the same thread?

 Defenitely no problem.
 The most frequent error when using ICS components in a thread is to
forget
 you must create the component from with the thread's execute method. If
you
 create the component from the thread's constructor, then all events will
be
 executed in the context of the creating thread (usually the main thread).
 And this may cause a lot of trouble.

 In my current app, I only have a main thread. So, does this, ...this
 may cause a lot of trouble, apply?

Yes, since you are creating new threads. If you create the components in the
thread constructor (or drop it on the form), their event handler will run in
the main thread context which is the active thread when the constructor is
called. You /MUST/ create the component from the Execute method (or any
method called from the Execute), and destroy it from the Execute method.

You cannot have on ICS component (let's talk about FTP as an example)
dropped on a form and the create a few threads, each one using the same
component to do file transfer. That will /not/ work. You need a separate
component for each concurrent file transfert no matter if you use threads or
not.

 I should expect trouble if I have
 multiple ICS components all executing on the main thread?

ICS is asynchronous, so you /DONT NEED/ multithreading to do several things
simultaneously ! You /MAY/ use threads to benefit from multi-processor/core
systems or to do lengthy processing. But this is defenitely required for
ICS. If you want to query 4 webpages at the same time, just use 4 HTTP
client components and call GetAsync on each one. They will all 4 do their
job in parallel without blocking each other and without using threads.

--
francois.pie...@overbyte.be
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://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [Fwd: Re: Conflicts between multiple instances]

2009-07-16 Thread Mike Lenox

I guess I am not being very clear.

I am not creating other threads. I only have one ... the main Delphi thread.

I am creating different ICS components, a TTnCnx client and a 
TWSocketServer in separate parts of my application. There are no shared 
global variables and the two instances are in different units so no 
shared local variables.


BUT, the two objects seem to be interacting with each other as I get a 
TTimer access error ONLY when both objects are active and I make an 
actual connection to the server.





Yes, since you are creating new threads. If you create the components in the
thread constructor (or drop it on the form), their event handler will run in
the main thread context which is the active thread when the constructor is
called. You /MUST/ create the component from the Execute method (or any
method called from the Execute), and destroy it from the Execute method.

You cannot have on ICS component (let's talk about FTP as an example)
dropped on a form and the create a few threads, each one using the same
component to do file transfer. That will /not/ work. You need a separate
component for each concurrent file transfert no matter if you use threads or
not.

  


--
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] [Fwd: Re: Conflicts between multiple instances]

2009-07-16 Thread Arno Garrels
Mike Lenox wrote:

 BUT, the two objects seem to be interacting with each other as I get a
 TTimer access error ONLY when both objects are active and I make an
 actual connection to the server.

Both TWSocketServer and TTnCnx do not use a TTimer. If your code uses a
TTimer what is the event handler doing?  

--
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] [Fwd: Re: Conflicts between multiple instances]

2009-07-16 Thread Francois Piette
 I guess I am not being very clear.

Indeed...

 I am not creating other threads. I only have one ... the main Delphi
thread.

Ah !

 I am creating different ICS components, a TTnCnx client and a
 TWSocketServer in separate parts of my application. There are no shared
 global variables and the two instances are in different units so no
 shared local variables.

 BUT, the two objects seem to be interacting with each other as I get a
 TTimer access error ONLY when both objects are active and I make an
 actual connection to the server.

Are you able to write a stripped down version of your application which is
small and standalone and reproduce the problem you have ?

--
francois.pie...@overbyte.be
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://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [Fwd: Re: Conflicts between multiple instances]

2009-07-16 Thread Mike Lenox
That's good information. I am not surprised if the TTimer is mine. BUT, 
the issue is still that I only get the error when I have both ICS 
components running. This implies that they are somehow interacting. Is 
there any possibility of that or any past complaints of such behavior?


Arno Garrels wrote:

Mike Lenox wrote:

  

BUT, the two objects seem to be interacting with each other as I get a
TTimer access error ONLY when both objects are active and I make an
actual connection to the server.



Both TWSocketServer and TTnCnx do not use a TTimer. If your code uses a
TTimer what is the event handler doing?  


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




No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.375 / Virus Database: 270.13.16/2240 - Release Date: 07/15/09 17:58:00


  


--
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] header too long HTTP_MIME_TOO_LONG

2009-07-16 Thread wayne forrest
I will try my best to describe the problem I am experiencing a bit better;

My PHP side I have this:

?php
session_start();
$a_longString1 = verylong1;
$a_longString2 = verylong2
header(xx: xx=$a_longString1);
header(yy: yy=$a_longString2);
?


On Dlephi side I have this:

var
 aString1,aString2 : String;
begin
  aString1 := HttpCli1.RcvdHeader.Values[xx: xx'];
  aString2 := HttpCli1.RcvdHeader.Values[yy: yy'];


aLongString1 is very long, and using the document/content is not an option
in my case;
and this would require some parsing.

I am not sure how one should pass the data from PHP to Delphi;

Should I be setting some HTTP HEADERS on the PHP SIDE, or maybe some
setting I can make to the APACHE server to get past this ERROR.

Maybe I must specify some MIME TYPE? or is this done by the APACHE SERVER ?

I used WireShark to get the HTTP_MIME_TOO_LONG error by watching the
network traffic.

I did not receive any error on the APACHE server nor on the Delphi side;
I have also noticed that as soon as the data becomes too large, then no data
is returned from
the PHP at all;

Any ideas are welcome please.



$alist does hold a long list of SQL data.
?php
session_start();
header(SQL_RESULTS: SQL_RESULTS=$alist);
?


On Tue, Jul 14, 2009 at 5:22 PM, Francois PIETTE
francois.pie...@skynet.bewrote:

 I am receiving an error: header too long HTTP_MIME_TOO_LONG
 when I call my php file, from HttpCli,
 *How shoud one I get the vars from php?*


 Not sure about what you mean by this sentence...

  I think that there is some kind of limit in the amount of data that can
 fit
 into the header.
 $alist does hold a long list of SQL data.
 ?php
 session_start();
 header(SQL_RESULTS: SQL_RESULTS=$alist);
 ?


 Why would you send your SQL data in the header ? You should probably send
 it in the document.

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




-- 
C: 076 337 4368
T: 021 880 2037
F: 021 880 2530
--
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] [Fwd: Re: Conflicts between multiple instances]

2009-07-16 Thread Arno Garrels
Mike Lenox wrote:
 That's good information. I am not surprised if the TTimer is mine.
 BUT, the issue is still that I only get the error when I have both ICS
 components running. This implies that they are somehow interacting. 

Why don't you debug the application? I guess an exception or access
violation is raised, isn't it? The call stack window of the IDE should 
contain useful information to track it down. What is the exception
message?
Another debug utility is MadExcept which is AFAIK still available
as a free version for non-commercial use or as a 30-days trial version.
It generates a bug report with call stack information including the 
source code line numbers, which you may want to post to this list.
Another great free tool is FastMM in full debug mode.

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