Re: [twsocket] Getting Local IP Address of a socket

2011-12-01 Thread Francois PIETTE
did mention about using ICS and LocalIPList property. But I simply could 
not find

the property/method. Anyway, thanks again for the pointer.


LocalIPList has nothing to do with a specific socket, it is a global 
function returning the lists of all local IP addresses.


--
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] Getting Local IP Address of a socket

2011-11-30 Thread Francois PIETTE
I tried to read WsocktServer1->LocalAddr  but the value is 0.0.0.0; Is 
there

a way (using ICS) to get what ip does a socket bind to?


A server socket is either bound to ALL IP addresses or to a single one.
When bound to a single IP, you - as the programmer - select which one by 
setting the Addr property to that IP. If you use 0.0.0.0, the socket is 
listening to ALL IPs.


--
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] Evaluating TOverbyteIcsSysLogServer

2011-11-11 Thread Francois PIETTE

Changes applyed.
Thanks.
--
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] Evaluating TOverbyteIcsSysLogServer

2011-11-11 Thread Francois PIETTE

Hello Peter,

Thanks for your feedback. While you are at it, maybe you could fix the 
issues you see and propose it to the community ?
Before doing that, be sure to download the very latest development snapshot, 
preferably directly out of the SVN repository. Then make your changes and 
submit a SVN diff file.


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

-Message d'origine- 
From: Busai Péter

Sent: Friday, November 11, 2011 11:40 AM
To: ICS support mailing
Subject: Re: [twsocket] Evaluating TOverbyteIcsSysLogServer


If client hostname contains negative sign "-" , for example 
"somename-peter", than between lines 520-532 it is evaluated as "invalid 
PID delimter" and an exception is raised.

I dont know if this is a valid hostname for that RFC

Some digging in the RFCs:

http://tools.ietf.org/html/rfc5424#page-13

 "The HOSTNAME field SHOULD contain the hostname and the domain name of
   the originator in the format specified in STD 13 [RFC1034 
]"


According to RFC1034 a hypen is a valid character.
http://tools.ietf.org/html/rfc1034 Page 10.

IMHO unit OverbyteIcsSysLogServer.pas function GetWord should also check
for hypen-minus "-" character

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


Re: [twsocket] TcpSrv and CliDemo - Connection Problems

2011-11-04 Thread Francois PIETTE
Hi,

Your message has not reached the mailing list for unknown reason...

I have no idea. The most likely is a firewall (internal to Windows or external 
in the network infrastructure you are using.
You said the server is listenig on port 336. OK, but is it on the correct 
interface ?
Try with another port, try with another client (for example command line 
windows own telnet).

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


From: Mike Gibbard 
Sent: Thursday, November 03, 2011 6:39 PM
To: twsocket@elists.org 
Subject: TcpSrv and CliDemo - Connection Problems

Hi,

I've been running the TcpSrv and CliDemo demo code very successfully on my 
local network.  I've set the TcpSrv exe to listen on port 336 and, when I point 
the CliDemo exe to localhost on port 336 the connection is established.  If I 
move TcpSrv to another machine (on the same network), I point the CliDemo to 
that machine's IP address on port 336 and the connection is established. Great!

However, when I move the TcpSrv exe to my remote server, the CliDemo exe times 
out and fails to connect.  

The Server exe is listening on port 336 and I've confirmed this with netstat.  
There's no firewall running on the remote server (Windows 2003) and I've 
disabled the firewall on the machine on which I'm running the CliDemo exe.  
Therefore, as far as I can see, there's nothing blocking outgoing connections 
on the client machine, nothing to block incoming connections on the server and 
the server exe is listening on port 336 on the server machine. I can ping the 
server machine

As networking is not my area of expertise, can anyone suggest any reason(s) why 
I cannot connect?  Do I have to set any particular type of permission on the 
server?  Is there something I have to do with my router?  I'd be very grateful 
to anyone who might be able to help.

many thanks,

Mike
--
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] XE2 update #2

2011-11-02 Thread Francois PIETTE

http://docwiki.embarcadero.com/RADStudio/XE2/en/Release_Notes_for_XE2_Update_2

--
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] THTTPCli fail to resolve URLs that start with "//"

2011-10-27 Thread Francois PIETTE
This kind of change would be interesting if implemented in a way that a 
derived class can implement his own parser. The base class in ICS would then 
parse the URL as currently and the developer would be able to create a 
derived class (component) which override the standard behaviour with 
whatever is required by his specific context.




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

-Message d'origine- 
From: RTT

Sent: Friday, October 28, 2011 12:12 AM
To: ICS support mailing
Subject: Re: [twsocket] THTTPCli fail to resolve URLs that start with "//"

On 27-10-2011 18:33, Arno Garrels wrote:

I'd be happy to see more contributions from the ICS users in general.


1st change

In unit OverbyteIcsUrl, procedure ParseURL(..., replace

if (url[1] = '/') then begin
{ Relative path without protocol specified }
proto := 'http';
p := 1;
if (Length(url) > 1) and (url[2] <> '/') then begin
{ Relative path }
Path := Copy(url, 1, Length(url));
Exit;
end;
end

by

if (url[1] = '/') then begin
{ Relative path without protocol specified }
proto := 'http';
if (Length(url) > 1) then begin
if (url[2] <> '/') then begin
{ Relative path }
Path := Copy(url, 1, Length(url));
Exit;
end else
p:=2;
end
else begin
Path := '/';
Exit;
end;
end

2nd Change

In unit OverbyteIcsHttpProt, procedure THttpCli.GetHeaderLineNext, replace

if Field = 'location' then begin { Change the URL ! }

by

if Field = 'location' then begin { Change the URL ! }
if Copy(Data,1,2)='//' then
Data:=FProtocol+':'+Data;
--
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


Re: [twsocket] THTTPCli fail to resolve URLs that start with "//"

2011-10-27 Thread Francois PIETTE
RFC2616 references RFC2396 as a source of information about URI in the 
description of a general syntax (Chapter 3.2.1). Then the next chapter 
(3.2.2) specifies the http URL which /must/ start with the "http:" scheme.


In my opinion, a HTTP client should not handle URL not starting with the 
HTTP scheme altough a browser may do it because a browser support many 
schemes, and probably default to the http: scheme if none is given (check 
that with a network sniffer).


By the way, in which real situation are you confronted with URL without 
scheme ?


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

-Message d'origine- 
From: RTT

Sent: Thursday, October 27, 2011 9:01 PM
To: ICS support mailing
Subject: Re: [twsocket] THTTPCli fail to resolve URLs that start with "//"

On 27-10-2011 19:28, Francois PIETTE wrote:
If I'm wrong, please point me to the exact text in the /HTTP/ standard 
(RFC2616).



From RFC2396, that merge RFC1808 with two others, and that is

referenced in the RFC2616.


absoluteURI   = scheme ":" ( hier_part | opaque_part )

   URI that are hierarchical in nature use the slash "/" character for
   separating hierarchical components.  For some file systems, a "/"
   character (used to denote the hierarchical structure of a URI) is the
   delimiter used to construct a file name hierarchy, and thus the URI
   path will look similar to a file pathname.  This does NOT imply that
   the resource is a file or that the URI maps to an actual filesystem
   pathname.

  hier_part = ( net_path | abs_path ) [ "?" query ]

  net_path  = "//" authority [ abs_path ]

  abs_path  = "/"  path_segments



 The syntax for relative URI takes advantage of the  syntax
   of  (Section 3) in order to express a reference that is
   relative to the namespace of another hierarchical URI.

  relativeURI   = ( net_path | abs_path | rel_path ) [ "?" query ]

   A relative reference beginning with two slash characters is termed a
   network-path reference, as defined by  in Section 3.  Such
   references are rarely used.

So, for this error in particular, seems to be a relative URI, in the
"net_path" form.

I haven't investigated if this form of relative (quasi absolute, except
for the unknown scheme) URI is valid as start URI, but browsers accept
it without problem.
But seems to be valid in a relocation, where relative URIs have to be
handled.

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


Re: [twsocket] THTTPCli fail to resolve URLs that start with "//"

2011-10-27 Thread Francois PIETTE

According to the rfc1808.txt, an URL can start with //
The ParseURL function will fail in such cases. Also, during a relocation, 
the THTTPCli fail to parse a "location" field with such URLs.

Here is an example, that result in a relocation with these characteristics
http://twitpic.com/show/thumb/73aj3p


I have not read RFC1808 in details, at least I have not found where this 
kind of URL is valid in the context of a HTTP client.
Maybe there is a confusion between an URL which can be found within a HTML 
document and a URL which is valid within a HTTP request ?


If I'm wrong, please point me to the exact text in the /HTTP/ standard 
(RFC2616).


--
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] SMTP Server

2011-10-24 Thread Francois PIETTE
I'd like to add to a desk application (C++Builder) running under W7 pro, 
the

possibility for the user to send emails from this program. The TSmtpCli
component is very convenient for that purpose, but the Smtp Server is not
very easy to find, when it exists, in the register.


You don't need to know the SMTP server of the company ! ICS SMTP client is 
able to send emails directly to the recipient SMTP server and you can use 
the ICS DNSQuery component to lookup for the SMTP server handling a given 
email address. You extract the domain from the address (what is after the at 
sign) and use it to query the "MX Record" using the  ICS DNSQuery component 
which returns a list of SMTP servers for the domain (one or more).


Please note that many SMTP server won't accept email comming from a 
dynamically allocated IP address.


--
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] HttpServer and Server-push?

2011-10-23 Thread Francois PIETTE

Why don't you announce it on your web site and this list with an
announcement?


It is announced since we are talking about it. But obviously, you used the 
wrong conversation and the wrong subject.
Please note that I have not said that I will do it. Let's first see how much 
money we can collect. This is a works requiring probably a few hundreds of 
work hours which can be inserted in spare time and as such require a lot of 
money for peoples like me who earn their living by programming. Remember, 
most of ICS is a subproduct of my own business. I have not developped ICS 
for fun or because I didn't know what to do of my time. Instead, I 
programmed actual real world application requiring TCP/IP protocol support 
and I was kind enough to share that part of my work. As far as I know, this 
is the same for other major contributors to ICS. Thanks to them.


--
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] HttpServer and Server-push?

2011-10-22 Thread Francois PIETTE

 I think we all need SPDY support:

http://en.wikipedia.org/wiki/SPDY



Interesting. Why don't you start the development ?
Using TSSLWSocket should be OK for that purpose.



Unfortunately I do not have that much time. Why don't we collect some
donation from members for some dedicated coder to implement this just as we
did for ICS-SSL? Fastream can donate $600 to it for client and server.


OK, let's see how many peoples are willing to contribute for how much money.
This is how ICS-SSL has started...

--
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] Purposal to remove the none finished .NET code from across platform ICS (IPv6 branch)

2011-10-22 Thread Francois PIETTE

With upcomming cross platform support new IFDEFs are required.
The V7 DotNet port Francois committed a few years ago has never
been finished and in the meanwhile a lot of development took
place with zero care about .NET compatibility. As a result
current .NET state is in a very bad state and I doubt that anybody
is willing to change that. That's why I'm thinking about to remove
the .NET stuff completely from the IPv6 source code when my cross
platform changes (Mac OS and FireMonkey) are committed.
What do you think? It's certainly sad, however the cleaner way IMO.


Agreed.
Will probably be better to start again from scratch the day we need a 
version for Delphi Prism (.NET).


--
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] HttpServer and Server-push?

2011-10-22 Thread Francois PIETTE



I think we all need SPDY support:
http://en.wikipedia.org/wiki/SPDY


Interesting. Why don't you start the development ? Using TSSLWSocket should 
be OK for that purpose.


--
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] TSslWSocketClient & Download

2011-10-20 Thread Francois PIETTE

I am having server and client built with TSslWSocketClient & Server.
I would like to to make client to download bunch of files from the server 
when it gets the command from the server.

The command will be a list of the files to download.
Is this possible?


Sure, it is basically what a FTP server and client are doing.


Please notice,
I do not want FTP, I need to be able to do this with sockets.


OK, but why ? FTP is of course based on sockets.
And of course you may write your own protocol, but at first glance what you 
ask is so close to FTP (FTPS to be more exact) that probably you'll just 
reinvent the wheel. Let us know why you don't want FTP...


--
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] HttpServer and Server-push?

2011-10-18 Thread Francois PIETTE

I then need to be able to send HTTP messages (xml documents) back from
the server to the client periodically
or as and when I need to, down the already open connection. The client
still needs to be able to respond to these
messages.


Since you seems to control both client and server side, I wonder why you 
need to use HTTP protocol. Why don't you design your own custom protocol 
tailored to fit your needs ? Of course, your own protocol may use port 80 if 
it is what is open.


--
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] ICS and FireMonkey

2011-10-18 Thread Francois PIETTE

FYI: Here's the next one, HttpsTst demo live on the Mac:
http://www.bilder-space.de/show_img.php?img=40aadd-1318952812.png&size=original
SSL worked more or less out of the box :)


Waouw !


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] ICS and FireMonkey

2011-10-12 Thread Francois PIETTE

Interesting screenshot:
http://www.bilder-space.de/show_img.php?img=955c9e-1318435341.png&size=original


Great !

--
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] To which file is explanation of each methods (put, dir, dele, etc.) of TFtpCli written?

2011-10-03 Thread Francois PIETTE


Hello 日本気象(株) 荒二井 勇 ,

PLEASE when replying, please edit your Subject line so it is more specific 
and trim the message to keep only relevant part for discussion.


To which file is explanation of each methods (put, dir, dele, etc.) of 
TFtpCli written?


They directly matches the FTP specifications: 
http://www.ietf.org/rfc/rfc959.txt
You may also have a look at 
http://wiki.overbyte.be/wiki/index.php/TFtpClient


--
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] about TFTPClient

2011-10-01 Thread Francois PIETTE

Hello,

Please see OverbyteIcsFtpTst sample program. You can find it in ICS
distribution.
If you need more help, please ask for specific questions.

Regards,


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

-Message d'origine- 
From: 日本気象(株) 荒二井 勇

Sent: Saturday, October 01, 2011 12:34 PM
To: twsocket@elists.org
Subject: [twsocket] about TFTPClient

ICS
TFTPClient is used.
Please teach me the method of the following programs.
1. It is the method of grasping the existence of the file which a FTP server
specifies.
2. Moreover, Method of Getting to Know File Size of the File
I would appreciate your favor.


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

Re: [twsocket] happy independece day ICS

2011-09-26 Thread Francois PIETTE

Fake site !!!


I have unsubscribed the guy. His system is probably infested.
Sorry for inconvenience.

--
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] DLL implementation advice (or example)...

2011-09-17 Thread Francois PIETTE
I see. The idea is the usage of the widestring just as a easy way to call 
the, behind the scene, SysAllocString and SysFreeString, that we need in 
this case. But we can always treat it as a buffer, setting its length, and 
moving data, explicitly, without casting.


In my opinion, it is ALWAYS a bad idea to use a string variable (whatever 
string flavour it is) to store anything else than actual text data.



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] Undeclared identifier: 'TSslWSocket'

2011-09-16 Thread Francois PIETTE

Add USE_SSL in the conditional defines for your project options.

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

-Message d'origine- 
From: Daniel Legrand 
Sent: Friday, September 16, 2011 12:44 PM 
To: twsocket@elists.org 
Subject: [twsocket] Undeclared identifier: 'TSslWSocket' 


Hi,
I have just switched to DelphiXE and started to build my first project with
ICS SSL Components.

I can't run my project because it keeps giving me the following error,
[DCC Error] Unit1.pas(16): E2003 Undeclared identifier: 'TSslWSocket'

My project got nothing in it, it is just a test for making ICS work.
I have add the path to the library, installed and reinstalled, rebuilt etc.
nothing seems to help.

The interesting thing is,
I got an old project which was made with Delphi 2007 and I can run/compile
it with no problems but if I take a new project and put the components on
and run I get the same error

Please help!!

Thanks in advance

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


Re: [twsocket] ICS v7 for XE2 online now - Thanks

2011-09-02 Thread Francois PIETTE
I would like to send a special thank you to both Arno Garrels and Angus 
Robertson. ICS for Delphi XE2 64 bit is here because those two highly 
expermented volunteers worked hard. Double special thank you to Arno who 
made the 64 version alive.


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

-Message d'origine- 
From: Arno Garrels

Sent: Friday, September 02, 2011 1:42 PM
To: ICS support mailing
Subject: [twsocket] ICS v7 for XE2 online now

Hello All!

As you probably already noticed XE2 RTMed yesterday.
You'll find ICS on the XE2 partner DVD however I suggest to
always pick latest source code from the ICS wiki site,
preferably using a SVN client:
http://wiki.overbyte.be/wiki/index.php/ICS_Download
(There are already two small fixes included in the C++
Builder examples since partner DVD release)

The experimental IPv6 branch has been updated as well:
svn://svn.overbyte.be/ics/branches/icsipv6
or
http://svn.overbyte.be:8443/svn/ics/branches/icsipv6

Both user and password "ics".

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


Re: [twsocket] multithread server

2011-08-17 Thread Francois PIETTE
Sometimes Windows triggers OnDataAvailable when no data is actually 
available. This is how it works. It is safe to ignore it. The most important 
is to call Recv (or any derivative) anyway. Using RcvdCount to decide to 
call or no Recv is wrong. Always call Recv which is the only one to actually 
reset winsock internal flag.



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

-Message d'origine- 
From: Lukas Skala

Sent: Wednesday, August 17, 2011 4:01 PM
To: twsocket@elists.org
Subject: [twsocket] multithread server

hello,
I have tcp server (developed as Windows Service) based on
OverbyteIcsThrdSrv1.pas demo. There is maximum of 200 clients. Server is
hanging after some time of running - it is unable to connect any new client.

I have added log in all events of TWSocketServer (оn events start line
and events end line). So I know that program is not hanging in any
events. I have some timer in service also and operation inside OnTimer
events are also logged. When server is hanged timer event is no more
triggered - it seems that main thread is very busy by triggering
OnClientDataAvailable - but in fact no data are incoming, function
RcvdCount in OnClientDataAvailable events returns zero and function
Receive returns -1 length (see part of log below please). Please what
does it means (why is this event triggered when no data are incoming?)
and how to avoid this behaviour?

17.08.11 15:42:52 I ClientDataAvailable started.
17.08.11 15:42:52 I Received from 89.24.4.161: 0 byte(s).
17.08.11 15:42:52 D Received -1 byte(s).
17.08.11 15:42:52 I ClientDataAvailable ended.

Thanks for any idea.
Lukas


--
lukas skala
envinet a.s.
divize projektu a inzenyringu (project and engineering division)
modrinova 1094
674 01 trebic

tel: +420 568 409 862 (811)
fax: +420 568 409 875
gsm: +420 724 461 062
icq: 66842878
eml: lukas.sk...@envinet.cz, luky.sk...@gmail.com
www: http://envinet.cz




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

Re: [twsocket] thread safety and async operation

2011-08-16 Thread Francois PIETTE

Is ICS safe for using in non-thread safe programs?


Yes of course.


i.e. is this scenario safe:
- single thread program writes to a disk file
- ICS is used to fetch something and written as buffer to the same disk 
file

and not corrupting previous wrte
- main thread is never interrupted by ICS events. i.e. ICS event does not
occur until some other event has finished.


Which component are you using ? I'll assume you use TWSocket. You - not the 
component - write data to disk. YOU are responsible for writing data at the 
right place into the file. If necessary you may use file locking.



in other words, my question is - is ICS async operation only async for
fetching data and not for events?


Sorry, I don't understand.


to expand the question - is any event, not just ICS something that can
interrupt program flow in a way to create additional thread to a single
threaded application?


ICS doesn't create thread of his own (At least not for writing data). An 
event never interrupt the main program, this is how WINDOWS work. Events are 
always triggered from the message pump. Events doesn't interrupt each other, 
unless you call the message pump from an event handler. Events are 
cooperative multitasking while multithreading is preemptive multitasking.


--
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] Multithreaded server not triggering SessionAvailableevent.

2011-08-14 Thread Francois PIETTE
I've been forced down the Multi-threaded server route as I'm using a 
client's

API that only works when on its own connection thread.


What kind of client API ?


Everything has been working fine except for an issue I get that when
the PC is busy with multiple connections, some new connections
don't fire the SessionAvailable event so I'm not aware of the connection.


I'll assume you are using TWSocketServer. Does it run in the mainthread or 
in a secondary thread ?
If events are not triggered, then something is using all cpu or blocking 
within the thread which runs TWSocketServer, or the corresponding message 
pump is blocked. Since you are multithreading, first look for interthread 
locking (WaitForSomthing API, CriticalSection API, Synchronize and such).



SysInternals ProcessExplorer reports the connections as established
but there's no way I can access them.


So connections has been accepted. SessionAvailable should trigger.


The problem is that the client has no timeout so remains connected
permanently. Even when I stop the server from listening the connect 
remains open.


Stopping to listen never break any existing connection ! Estalished 
connections have their own socket independant of the listening socket.



Has anyone has a similar issue?


Only when multithreading or windows meessaging rules are not respected.

Is there a way I can get a list of active sockets talking to my app 
similar to ProcessExplorer?


TWSocketServer has an array property with a refernce to all connected 
sockets: Client[].



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] [OT] Nice forum engine based on the mailing list

2011-08-08 Thread Francois PIETTE
As I already said a lot of times in the past, I don't want a newsgroup 
because I would loose control on the group.

Subject closed.

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] problem with ping and server index error

2011-08-07 Thread Francois PIETTE
We have a small issue with out client/server connection and disconnection 
code everything
works fine until a user connection fails from there site (internet kick) 
and then our server
will get a index error on sending ping to all users I think the problem is 
that the server
is still trying to send information to clients that are no longer active 
on the server.
so i was wondering if anyone else had this problem and what was the 
solution to fix it ?


Probably if you get an index error, then the server component is already 
aware the client is disconnected. You are using a twsocket reference which 
is no more in the client list. Before using that reference, you may call 
IsClient method to check if it still exists.


--
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] [OT] Nice forum engine based on the mailing list

2011-08-06 Thread Francois PIETTE

Since Win7 there's no mail reader available, shame on MS.



Not exactly, the good old Outlook Express has been renamed "Windows
Live Mail". It has a new "ribon tool bar" and slightly different
folder treeview, but it is still Outlook Express and it is still
free. Not delivered with Win7 itself, you have to download it. It is
able to import email from previous versions.



Does it actually include plain SMTP and NNTP? I had the impression from
the description that it is only some kind of strange webmail client with
built-in spy.


Bad impression. It support standard SMTP, POP3 and IMAP4 with same features 
as always.
I'm writing this message using it and the message will go out using SMTP. I 
read your message thru my POP3 account.


--
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] [OT] Nice forum engine based on the mailing list

2011-08-05 Thread Francois PIETTE

Since Win7 there's no mail reader available, shame on MS.


Not exactly, the good old Outlook Express has been renamed "Windows Live 
Mail". It has a new "ribon tool bar" and slightly different folder treeview, 
but it is still Outlook Express and it is still free. Not delivered with 
Win7 itself, you have to download it. It is able to import email from 
previous versions.


--
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] Triggering DataAvailable

2011-07-26 Thread Francois PIETTE
I'm using TWSocketServer to handle multiple incoming connections from a 
client's embedded unit.


Unfortunately the remote unit has a few limitations; the main one being 
that it can establish
an IP connection to a server but cannot send data until the server 
requests it.


This means that although the OnClientConnect function gets called, the 
OnDataAvailable does not.


I had put a line of code in the OnClientConnect to trigger the 
OnDataAvailable function

but this seems to be blocking other connections.


You should not do that. OnDataAvailable is triggered when the other side has 
sent data.



My questions are:-
i)Is there a way to trigger the OnDataAvailable 
function by post a message on the socket.


No way. Well, no way that has real meaning.

ii)   Is there a better way to do this without going to a 
threaded model.


No need to go multithreaded. You said: "cannot send data until the server 
requests it". This is the solution: once the embedded unit is connected send 
the request it waits. Probably the banner property is the place where you 
could place you request because banner is what the server component sent 
immediately when a client connect.


BTW and for my information, what kind of unit is this and what kind of 
request does it needs ?


--
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] Terminal Size Scaling

2011-07-13 Thread Francois PIETTE
Well I can only make it work if I use the edit options and manually dink 
with these until it works.. then if i resize the form, do it all over
again. Change the font size to be smaller or bigger, and tweak each other 
property until all is good. For the end user, that wont be acceptable.


Is there any better way to calculate the proper font size to use, and 
change all the other properties to make it so when the

end user resizes the form, it will scale right?


Use the OnResize event to calculate the chawidth and other parameters so 
that it fits well given the form size. At first it is simple computation.


--
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] TWSocket.Close() blocks on certainmachines aftersending UDP

2011-07-13 Thread Francois PIETTE
I just made a nice discovery. I found out that I had another machine (same 
model, but mini tower) sitting here somewhere. I checked, and the problem 
does not show there.


So I took the hard drive from the not working one and put it in the 
working one and it booted nicely (since hardware is identical). The 
problem moved too!
So I have a hard drive, which contains a super fresh copy of Windows 7 
which does not work, and another hard drive with an older Windows 7 
installation which does work.


This confirm what I said before: the problem comes from a software installed 
on the not working computer, not from the hardware. It is likely a 
difference in some driver.



Any tips or question what to compare or test?


First do an image of the working installation so that you can come back 
later to it after testing !
Then on the working machine do a windows update, and an update of evreything 
you can think off and check if it becomes a not working installation. If it 
does, then you have to find out exactly which update break the operation.


MsInfo32 could be an help to comprae both computers. The "running tasks" 
list gives the version number of each module. You can see if they are the 
same or not.


--
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] TWSocket.Close() blocks on certainmachines aftersending UDP

2011-07-13 Thread Francois PIETTE
Thanks for the links, it's an interesting read. What still goes beyond me 
though, is that all I see in the diagram seems to be hardware independent 
stuff, so how could it ever happen that it behaves different on different 
machines?


That's the point: IMO the issue comes from the software which is likely to 
be different on each system because different applications are installed and 
service pack level or patch order, or whetever is different.


if you have a brand new PC, two things are interesting:
1) Do a full backup on the offending backup and do a restore on the new 
hardware. If problem is gone then the hardware is the culprit. If the 
problem persists, then the software is the culprit and go to the second 
option

2) Reinstalling from scratch, with original media and see if it occurs.

--
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] TWSocket.Close() blocks on certainmachines aftersending UDP

2011-07-13 Thread Francois PIETTE
I don't think it is a hardware issue. It is likely a software issue. One 
of the layer between winsock and the network card has a bug. That is why 
you see it on one computer and not another.


Determining which layer is faulty will be a difficult task ! I don't know 
what to say to help you :-(


I agree that it's not a hardware issue. Do you know what layers are there 
approximately? I've already ruled out the driver of the NIC itself.
I was mentioning the chipset since there is also software applicable 
(driver of the chipset). Also strange is that I have more machines of same 
brand and model, which do not show the same behavior.

It's a nice mystery :)


Having a machine with same brand and model is a chance because you can 
compare both. Of course if they have different stories, it is likely they 
have not so comparable software installed.


There are a number of layers. The most probable culprit is a layer which 
"understand" the protocol. Probably the layers at packet level is not the 
cause otherwise there would be blocking for all protocols.


It is interesting to read "Windows® Internals" 
(http://fresh.amazon.com/product?asin=0735625301). The chapter 12 explain 
the networking. Figure 12.2 page 1005 is very intersting: "OSI Model and 
Windows Networking Components" http://book.51cto.com/art/200911/160900.htm. 
Text is at:

http://images.51cto.com/files/uploadimg/20091104/1038000.jpg

I suggest to anyone to buy this book. It is very very interesting to 
understand how Windows works !



I'll keep the list posted if I find more information myself.


Thanks a lot. This kind of information is very useful.

--
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] TWSocket.Close() blocks on certainmachines aftersending UDP

2011-07-13 Thread Francois PIETTE

AFAIR the workaround was to do your own ARP request first in order
to check whether the destination exists or not, utilizing the IP 
Helper API.



Yes, that what I did.



How can I confirm that this is what's happening with me?


In my case, the blocking was occuring in the main thread. TO see it it 
was then easy: using the mouse, I moved continuously the form in small 
circles. When blocked, the application don't paint the form and the 
window was stuck. Then using WireShark I was able to see that the 
blocking was when ARP requests were sent to non existant address.


I just did the same test and can confirm this is the case. The call to 
closesocket() is blocking until all 3 arp requests have been sent.


Now the interesting part is that on another Windows 7 machine the call to 
closesocket() is not blocking. When looking with wireshark I see that the 
3 arp requests are sent, but closesocket() simply does not wait for them.


I'm happy you see the same behaviour as I do.


I did a compare of winsock.dll and ws2_32.dll from both machines, and they 
are identical.
Does anybody have a good idea how to search for the cause for different 
behavior, or have an idea where it could originate from? Could it be 
something related to the chipset?


I don't think it is a hardware issue. It is likely a software issue. One of 
the layer between winsock and the network card has a bug. That is why you 
see it on one computer and not another.


Determining which layer is faulty will be a difficult task ! I don't know 
what to say to help you :-(


--
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] TWSocket.Close() blocks on certainmachines aftersending UDP

2011-07-12 Thread Francois PIETTE

AFAIR the workaround was to do your own ARP request first in order
to check whether the destination exists or not, utilizing the IP Helper 
API.



Yes, that what I did.



How can I confirm that this is what's happening with me?


In my case, the blocking was occuring in the main thread. TO see it it was 
then easy: using the mouse, I moved continuously the form in small circles. 
When blocked, the application don't paint the form and the window was stuck. 
Then using WireShark I was able to see that the blocking was when ARP 
requests were sent to non existant address.


--
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] TWSocket.Close() blocks on certainmachines aftersending UDP

2011-07-12 Thread Francois PIETTE

Was Francois able to find a way to make sure this is the case, or a
work around?



AFAIR the workaround was to do your own ARP request first in order
to check whether the destination exists or not, utilizing the 
IP Helper API.


Yes, that what I did.

--
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] Hang in TIcsWndControl.ProcessMessages

2011-07-12 Thread Francois PIETTE

Does anyone have ideas why TIcsWndControl.ProcessMessages could
hang sometimes when socket is used in separate thread?


Actually ProcessMessages probably doesn't hang. ProcessMessages it the 
place

from where all events are called. It is likely an event handler which is
blocking. You should try to find out where.


I call it like this, the only event that is called is SslShutDownComplete 
which
sets FSSLShutdownComplete property, I don't have any other event 
processing here


 FSocket.Shutdown(SD_BOTH);

 EndTime := GetTickCount + FTimeout;
 while {$IFDEF USE_SSL} not FSSLShutdownComplete {$ELSE} False {$ENDIF} do
 begin
   if GetTickCount > EndTime then
 break;
   Sleep(10);
   FSocket.ProcessMessages;
 end;


I don't know from where this code is called, but it CANNOT be called from an 
event handler originating from TWSocket.


ProcessMessage is actually calling the window procedure for all windows 
created in the thread context and in turn trigger events at the component 
level. If any event hanlder is blocking, the ProcessMessages looks blocking. 
Calling Synchronize will actually block the thread until the main thread has 
time to process a message.



--
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] TWSocket.Close() blocks on certain machines aftersending UDP

2011-07-12 Thread Francois PIETTE
I suggest you look at "security software" which may be installed on those 
PC. Some of those software (anti-malware, firewall, proxy,...) are 
malfunctionning in their interception of socket communication. So first do a 
test with every security software disabled.


It may also be a virus or trojan which intercept socket communication for 
malware. So here turn all security on, do an complete malware check (update 
your software !). Also try to detect root kits which may be there.


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

- Original Message - 
From: "Merijn Bosma" 

To: 
Sent: Tuesday, July 12, 2011 1:49 PM
Subject: [twsocket] TWSocket.Close() blocks on certain machines aftersending 
UDP




Hi all,

I've been using ICS for a long time, in different environments and on 
different machines without problems.
Now I've stumbled upon a problem of which at the moment I don't know how 
to find a solution for. It's regarding a snippet which sens data using 
UDP.

The relevant code boils down to:


  with TWSocket.Create(nil) do
  begin
   Proto := 'udp';
   Port := some port;
   Addr := some ip;
   Connect();
   SendStr('some data');
   Close();
   Free();
  end;

Very simple, and works great.

Now on two machines we have an issue while using this code. The call to 
Close() will block for 4 to 6 seconds if:

- I'm sending to an IP address within my own subnet
- There is no actual PC at that IP (doesn't have to be running a UDP 
server, just a PC with that ip address).


I've tried with different NIC's, and now I have a NIC on USB, which gives 
this problem on the 2 machines mentioned before (Win 7 Pro SP1), but do 
not have the same issue on another machine (Win 7 Pro SP1).


Obviously there is something with these two machines, but I'd like to know 
what is causing this to give me some control over it. These are brand new 
machines, firewall is disabled and all pre installed software is removed. 
I also have a support call at the manufacturer, but since there is not 
much promising result from them I'm hoping anyone here can give me a 
pointer in the right direction.


Thanks and regards!

Merijn

--
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] ICS registration

2011-07-09 Thread Francois PIETTE

Hi !

As you subscribed to ICS support mailing list, you probably use ICS. Good !
But have you taken time to register your ICS copy ?

ICS is freeware but to use it, you must register it.
Registration is very simple: just mail a [real, paper] picture postcard to
the author (me). You can find instructions in readme.txt file.

Thanks.

PS: If you already sent your picture postcard, simply ignore this message.
If you wants to know if I received it, then you must tell me when you sent
it, from which country and what the picture is (I have several thousands
postcards !).

--
francois.pie...@overbyte.be
The author for 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


[twsocket] Mailing list usage

2011-07-08 Thread Francois PIETTE

To all subscribers:

1) Please do not use HTML or RTF messages in the list. Use only plain/text
   messages (by default Outlook uses HTML ! You must change the setting).
   When replying, be sure to use plain/text. If someone email to list
   accidently NOT in plain text and if you reply to it, do take care you
   reply in plain text
2) Please do not include VCF to your messages.
3) Stay on topic ! Do not post off-topic messages and do not answer
   off-topic messages.
4) Always us a subject and change message subject when required. Do not
   change subject when not needed because message thread is lost.
   Always mention which component you talk about and OS version.
5) Do not attach files to your messages. If you have something to give, just
   tell us in the list. Interested people will contact you to get the file.
6) Post messages using the EMail address you used to subscribe.
   No alias allowed. If you use an alias, your message will not appears in
   the list.
7) If you change message subject please dont hit 'reply', but compose a
   new message. Some mail readers group messages per ID instead
   of subject.
8) Do not forget to send your registration postcard :-)
9) Forgive me if I didn't notifyed you for your postcard yet :-(
10) Add yourself to http://www.linkedin.com/e/gis/136245
 and also to http://www.frappr.com/icsandmidware
11) Don't forget there is an announce mailing list if you find traffic is
 too high on support list.
12) If you have problems with the list, do not complain in the list but
   directly to me.
13) Let Wilfried Mestdagh and me moderate the list.
--
francois.pie...@overbyte.be
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] Wiki : author wanted

2011-07-08 Thread Francois PIETTE

Hi !

As you probably know, we have a Wiki for ICS documentation: 
http://wiki.overbyte.be
A wiki is a collaborative tool. We already have a few authors writing 
articles. Actually not that much !


If you have some spare time, please use it to write some article in the 
wiki. If each ICS user write only a single page, we will have tens of 
thousands pages ! No need to know everything. It is enough if you know 
ONE thing. Just write a page and you'll enter the hall of fames :-)


To collaborate, just login onto the wiki and email me the usercode you 
selected. I will give you write permission.


Thanks a lot.

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


[twsocket] ICS group on social networks LinkedIn and FaceBook

2011-07-08 Thread Francois PIETTE

Hi !

Every ICS user is invited to be part of ICS-group on Linked-In. 
See http://www.linkedin.com/e/gis/136245
Why ? 
Just to have a little bit more visibility for everyone of us and for  ICS.


There is another one on FaceBook:
http://www.facebook.com/pages/ICS-Internet-Component-Suite/39493622127

btw: You may also be part of "Powered by Delphi" group on Linked-In.
http://www.linkedin.com/e/gis/48600

--
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] Multicast question

2011-07-08 Thread Francois PIETTE

Hi Emanuele,

I see that you seems to fully understand multicast. Can I ask you to write 
some description about multicast properties in ICS wiki 
(http://wiki.overbyte.be/wiki/index.php/TWSocket) ?


If you don't already have a write access to the wiki, I will grant it to 
you. Just let me know what is your login name on the wiki.


Thanks,
--
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] About OnChangeState event

2011-07-08 Thread Francois PIETTE
I am using ICS-V7 Distribution (October, 2010). I have encountered a 
problem when using this component:
I make a Connect() call to invalid address(that is no guy listen on that 
address and that port), after a while, the OnChangeState event fired, with 
the NewState = wsConnected, in this case, when I am tried to write to the 
socket,

an OnChangeState event with the NewState = wsDisconnected fired.

Is it excepted behavior?


Yes, it is expected. When you connect, you always goes thru the 
OnSessionConnected event (and corresponding OnChangeState). If the 
connection fails, OnSessionConnected has a non zero error argument. Then 
later you pass thru the OnSessionClosed.


You should not use OnChangeState event for anything else than displaying 
some UI feedback. For processing, use OnSessionConnected, OnSessionClosed 
and OnDataAvailable.


--
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] Hang in TIcsWndControl.ProcessMessages

2011-07-08 Thread Francois PIETTE

Does anyone have ideas why TIcsWndControl.ProcessMessages could
hang sometimes when socket is used in separate thread?



Have you followed the rules: create TWSocket within the thread's execute
method OR call ThreadAttach ?


Yes socket is created within threads execute method, and it works most of 
the time.

I call it after calling shutdown like this, could it be related?

 FSocket.Shutdown(SD_BOTH);


What do you mean by "I call it after..." ?

Actually ProcessMessages probably doesn't hang. ProcessMessages it the place 
from where all events are called. It is likely an event handler which is 
blocking. You should try to find out where.


--
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] Hang in TIcsWndControl.ProcessMessages

2011-07-07 Thread Francois PIETTE

Does anyone have ideas why TIcsWndControl.ProcessMessages could
hang sometimes when socket is used in separate thread?


Have you followed the rules: create TWSocket within the thread's execute 
method OR call ThreadAttach ?


--
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] Suggestion: set FLastError on session connect/disconnect

2011-07-07 Thread Francois PIETTE

See above. Pausing/resuming the socket shouldn't be used, specially if you

have your own worker thread. Just have the socket event handler blocked
waiting for some synchronization object.

You mean blocking the entire message loop?


Yes, indeed. If you don't want any socket event while outside of an exported 
fDLL function call, then it is enough to block the thread message pump which 
is only used for socket handling. This would effectively block any socket 
activity - and of course any event - when not in the context of a called 
function.


--
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] Suggestion: set FLastError on session connect/disconnect

2011-07-07 Thread Francois PIETTE

>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 create all of them on DLL load). And I export several 
functions

each of them uses its own socket.


A single thread is able to handle a lot of sockets (I have applications 
handling hundreds of sockets per thread). 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.



* return appropriate socket (create and init it if necessary, attach to 
the thread
with ThreadAttach - I can't create them inside Execute because it's more 
complicated with my design).


In my opinion, you should revise you design to better fit the programming 
model used for ICS. Otherwise you'll end up with a complex application 
difficult to maintain a prone to errors.


to avoid socket events outside the DLL functions —  or maybe I just may 
pause all the sockets?


Sockets events are always triggered in the context you the thread having 
created the socket or the trheaded haing the socket "attached". You should 
probably not call host application code from another thread than the one 
active at the time of the call to your DLL. This require some inter-thread 
communication and synchronization. This will result of more complex code in 
your DLL with the advantage of maximum isolation of the hosting application. 
This is important if you have no control on the hosting application and you 
don't know how it is working internally.



Questions are:
1) How to avoid socket events outside the DLL functions (I guess 
pausing/resuming
the sockets is better cause I'll only have one active socket at a time — 
the one I need)


See above. Pausing/resuming the socket shouldn't be used, specially if you 
have your own worker thread. Just have the socket event handler blocked 
waiting for some synchronization object.



2) Do I have to do socket.ThreadDetach on app closing or it's OK?


Yes, you have to detach the socket from the worker thread before destroying 
the socket.
As I said before, you can avoid thread Attach/detach with careful design. 
Having to use attached/detach is the sign of a too complex design.


Always apply the KIS principle (Keep It 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] Creatively annoying a host

2011-07-07 Thread Francois PIETTE

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


Well, this is possible, depending on how their are organized. Angus could 
count the number of simultaneous connection and add trhe delay only if this 
is below a level he select according to his server configuration. One 
thousand of delayed connections is probably not an issue at all.



Or send a vast amount of rubbish data in response?
Maybe — if you have unlimited outgoing traffic. But no chances that 
scanner software would
catch all of the rubbish sent. It could abort the connection after some 
amount of data

received and leave your server sending something to nowhere.


You are right, probably the scanner would simply throw away any data and 
probably close the connection. If the connection is not close, then data 
sent by Angus will at least use bandwidth at their side (as well as at Angus 
side).


--
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] Suggestion: set FLastError on session connect/disconnect

2011-07-07 Thread Francois PIETTE

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 and got a question. I see that 
in DLL demo the thread is responsible for message processing. But what if 
I don't need a thread? I tryed with while .. do MessagePump but noticed 
that it processes even the messages of the host app! So no sync here. I 
suspect console demo approach won't work for me too (am I right?)


If you don't created a thread with his own message pump, then you rely on 
the host application which may or may not have a message pump and may do 
stranges things with his message handling. 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.



2Francois:
If you need to export synchronous functions out of your DLL, I would 
suggest using a thread

withing the DLL, having his own message ump and working purely
asynchronoulsy as ICS does so well. Then the exported function will talk 
to
this thread using traditional multithread synchonization mechanisms to 
looks

blocking from the outside. A Windows event is a perfect item for that kind
of job: the exported function will start the asynchonous operation by the
worker thread and wait on an event which will be set by the worker thread
once the work is done. Quite easy to implement without any change in 
TWSocket.
Yeah, I guess it's the only way. I have to create separate thread or a 
socket would process host app events while waiting. I'll consider DoneFlag 
or even Events to easily implement waiting.



If you really want to do something like you have show, do NOT loop on
the state property value but use the events and your own application level
state variable. TWSocket.State has never been intended for waiting on a
given state.

Hmm you mean State isn't reliable? But why?


State is reliable, but only from the event handlers, not at anytime as seen 
from the outside. This is how Windows event handling is working: the state 
variable is updated inside an event hanlder and that event handler may 
execute code before exiting. The safer way to access the state variable is a 
the point where the component user is at control: during the event handlers 
he has installed.


Antoher way to consider this is that you have two asynchronous processes 
(Those are not processes in the sense they are defined within Windows): 
TWSocket code and your own code. The link between the two process have been 
designed to work at specific spot in time : when the component triggers an 
event.


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





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


--
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] Suggestion: set FLastError on session connect/disconnect

2011-07-07 Thread Francois PIETTE
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
 //..
 Exit;
   end;
 end;
...send request...
end;


Why would you like to implement such code ? You'll just waste CPU cycles. 
There are a lot of easy way to use async operations in a DLL. If you need to 
export synchronous functions out of your DLL, I would suggest using a thread 
withing the DLL, having his own message ump and working purely 
asynchronoulsy as ICS does so well. Then the exported function will talk to 
this thread using traditional multithread synchonization mechanisms to looks 
blocking from the outside. A Windows event is a perfect item for that kind 
of job: the exported function will start the asynchonous operation by the 
worker thread and wait on an event which will be set by the worker thread 
once the work is done. Quite easy to implement without any change in 
TWSocket.


btw: If you really want to do something like you have show, do NOT loop on 
the state property value but use the events and your own application level 
state variable. TWSocket.State has never been intended for waiting on a 
given state. It has been designed for internal use and for informational 
purpose only. Events are the way to go to trigger state change into your own 
finite state machine related to your own application.


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


[twsocket] [OT]Delphi Belgian User Group

2011-07-02 Thread Francois PIETTE

Hello,

I have created a LinkedIn group for belgian Delphi users. I mean either 
belgian citizens, or peoples working in Belgium. The link is: 
http://www.linkedin.com/groups?home=&gid=398


Regards,
--
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] Memory leak in ICS Client socket

2011-07-01 Thread Francois PIETTE
I am using TSSLWSocket and I would like to know why I get memory leak 
error while using the following at the “OnFormCreate”,


RecStream := TMemoryStream.Create;

Any ideas about what am I doin wrong?


At first, this is not related to ICS: If you create a memory stream or any 
other object, then you must destroy it at some later point calling his Free 
method or preferably using FreeAndNil(RecStream).


--
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] Latest supported SSL version

2011-06-22 Thread Francois PIETTE

can someone please inform,
what are the latest supported SSL packages and DLL files?
Where can I get them?


http://wiki.overbyte.be/wiki/index.php/ICS_Download

--
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] HttpServer and password...

2011-06-15 Thread Francois PIETTE

Empty password should be usable indeed.

--
francois.pie...@overbyte.be
http://www.overbyte.be

- Original Message - 
From: "Arno Garrels" 

To: "ICS support mailing" 
Sent: Wednesday, June 15, 2011 6:56 PM
Subject: Re: [twsocket] HttpServer and password...



Francois PIETTE wrote:

A 401 is returned.

What am I missing?


As I told you in my previous message, you missed that password
(passed as var to the event handler) is initialized to #0 which is
NOT an empty string. 


I also do not understand why that has something to do with the fact
that both THttpCli and THttpServer require a non-empty password string
to handle authentication, one snipped from THttpCli:

{code}
   if (FStatusCode = 401) and (FDoAuthor.Count > 0) and
{$IFDEF UseNTLMAuthentication}
  (FAuthNTLMState = ntlmNone) and
{$ENDIF}
{$IFDEF UseDigestAuthentication}
  (FAuthDigestState = digestNone) and
{$ENDIF}
  (FCurrUserName <> '') and (FCurrPassword <> '') then begin
   { We can handle authorization }
{code}

I think that is a bug, though empty passwords are rarely used.

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


Re: [twsocket] Wiki article writing incentive idea

2011-06-15 Thread Francois PIETTE

Francois, what do you think?


I think I will not have more than 2 peoples creating something. Not worth 
the effort.


--
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] HttpServer and password...

2011-06-15 Thread Francois PIETTE

I was finally able to get back to the password failing when it is empty.
(which is OK)

The lines in the source code that prevent the '' password appear to be:

unit OverbyteIcsHttpSrv;

function THttpConnection.AuthDigestCheckPassword(const Password: String):
Boolean;
...

   if Password = '' then begin
   Result := FALSE;
   Exit;
   end;



A 401 is returned.

What am I missing?


As I told you in my previous message, you missed that password (passed as 
var to the event handler) is initialized to #0 which is NOT an empty string.


--
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] SSL server and CLient cert.

2011-06-15 Thread Francois PIETTE

Anything that works for Apache would work since they use OpenSSL as well.



Thanks for the response :)
I am so sorry :(, forgot to tell...
I am not using SSL for web communication, I am using the SSLServer and 
SSLClient for client to host connection.
I believe this has got nothing to do with Apache because there is no 
apache used.


What SZ is saying is that Apache and ICS both use OpenSSL. So any 
certificate OK for Apache is OK for OpenSSL and is OK for ICS.


You can also use OpenSSL comand line utility to convert certificates for 
some format to other OpenSSL compatible format. I've done it to to convert a 
certificate exported from IE.


--
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] FTPClient Localfilename

2011-06-11 Thread Francois PIETTE
How I can download a file in memory instead on disk using the command GET 
?


Use a TMemoryStream instance and assign it to LocalStream property

--
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] IPv6 support ?

2011-06-08 Thread Francois PIETTE

On this subject, does ICS team plans to release official support for IPv6?


Arno already done most of the work, so yes it is intended to release it 
someday.

We need testers and you are welcome to participate.

As you probably know, Embarcadero is preparing the next release. ICS must be 
ready and we expect a lot of work in the comming months so IPv6 is not the 
major priority.


--
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] HttpServer and password...

2011-06-05 Thread Francois PIETTE

The password field is blank in OnAuthGetPassword. I do not change the
'Password'. It is #0.



You should probably change Password to the empty string. #0 is /not/ the
empty string. This has been designed so that you can use an empty password
which is different than not changing Password var parameter !


During testing I set the var Password to '' and had the same result.

Password:='';

Is there some other way I should do it?


This is the proper way. Please use the debugger to see what happend to your 
password. You'll quickly see the test and see the reply prepared by the 
component to send to the client browser.


--
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] HttpServer and password...

2011-06-05 Thread Francois PIETTE

The password field is blank in OnAuthGetPassword. I do not change the
'Password'. It is #0.


You should probably change Password to the empty string. #0 is /not/ the 
empty string. This has been designed so that you can use an empty password 
which is different than not changing Password var parameter !


btw: When you have this kind of problem, I suggest you use Delphi debugger 
to see what happend when you return from the event handler. Just be sure to 
add VC32 in the search path so that Delphi find the component source and is 
able to single step in it.


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


- Original Message - 
From: "zayin" 

To: 
Cc: 
Sent: Sunday, June 05, 2011 5:51 PM
Subject: [twsocket] HttpServer and password...



Hello,

HttpServer version 7.29.

I set the server to: HttpServer.AuthTypes:=[atBasic,atDigest]

The user tries to logon and enters his name. For this user he does not 
have

a password and that is OK with me. The browser is using digest mode.

The password field is blank in OnAuthGetPassword. I do not change the
'Password'. It is #0.

But the logon fails.

OnAuthResult has false in success.

What am I doing wrong? Must the user have a password?

Thanks,

Mark

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


Re: [twsocket] Socket troubleshooting...

2011-06-02 Thread Francois PIETTE

My ICS client socket application crashed when the host (not ICS based)
failed.

MadExcept captured the following. If this is meaningful to someone, I'd be
interested in any observations/suggestions.



exception message : The application seems to be frozen.


MadExcept tries to detect that an application is still responding. Actually 
MadExcept has a thread to do that and it send messages to the main thread. 
It is likely that your application is probably very very slow for some 
reason when the host (not ICS based) crashes. Maybe your program enter an 
infinite loop or something like that.


Beside madexcept message, what do you see ? Is you GUI still responding ?
MadExcept has settings to twek this detection.

--
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] TMultipartHttpDownloader and TMultiProgressBar

2011-05-31 Thread Francois PIETTE

Please tell me, can I set a password and a user-name for Proxy in
TMultipartHttpDownloader?
Can I remove blinks of TMultiProgressBar when it works? And can I change a
color of a bar (not background) of TMultiProgressBar?


I wrote the component and demo long time ago. I don't remember the details 
right now. I think you should be able to read the source code yourself, 
understand how it works and then make the changes you need. You'll probably 
learn a lot.



Additional question: what about a progress for THTTPCli?


Use OnDocData and OnSendData events to update your progress bar. Use 
RcvdCount and SentCount properties as well as ContentLength.


Again, please look at the source code. If you had searched for "progress" in 
the source code, you'd found the answer yourself.


--
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] download several files sequentially

2011-05-30 Thread Francois PIETTE

"If you want to download several files sequentially, just build a list of
files and use one component to download each file after the each other."


Question: how can I perform this? I am trying to make a list and download 
a

next file working with  a "RequestDone" event. But I have an error
(EAccessViolation at address) when I use component to download other file.


You need one component per file.


Can you write a couple of strings of code how to do this?


Just have a look at the sample program OverbyteIcsHttpAsy which is part of 
ICS distribution :-)

It shows how to download many files, either sequentialy or simultaneously.

--
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] download 2 and more files at once usingTMultiPartHTTPDownloader

2011-05-28 Thread Francois PIETTE

How can download couple files at once
using TMultiPartHTTPDownloader ? I can add only one file into
MultiPartHTTPDownloader to download, what about more files than one?
Can I create a list of files to download?


TMultiPartHTTPDownloader is a component aimed at downloading a single file 
but using multiple connections simultaneously. On some servers, this will 
make the global thruput higher. This is effective for server having some 
kind of bandwidth limitation. When bandwidth limitation is per connection, 
then using many connections will speedup things.


If you want to download several files simultaneously, which is different 
than a single file with several connections, then simply use one component 
per file.


If you want to download several files sequencially, just build a list of 
files and use one component to download each file after the each other.


For multiple files, you may use THttpCli or TMultiPartHTTPDownloader 
component depending on how you want things to be done.


Downloading several files simultaneously and/or using multiple connection 
could slow down overall tranfer, or speed it up. It depends on many many 
factors.


--
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] Computer's name

2011-05-24 Thread Francois PIETTE
I don't know how to make sure there won't be any other machines in 
between, I mean to make sure both data belongs to the same computer.


My question is,
How can I set both messages comes in the same time like one whole message 
or combine them by the server as one message?

Is there any ways of doing this?


You know that both messages are from same client because it is the same 
TWSocketClient instance which make it available to you. This is why I told 
you to store that information into your own class derived from 
TWSocketClient. This is shown in OverbyteIcsTcpSrv1.pas source in the demos. 
The derived class is named TTcpSrvClient and has only two members (This is 
just a demo which is kept as simple as possible).


In that sample, see for example how ConnectTime member is handled and do the 
same with all your informations.


In order for TWSocketServer to use YOUR class, you must initialize his 
ClientClass property. Again, see the sample code.


The Client argument in TWSocketServer event are refering to the instance of 
YOUR class handling a particular and unique connection.
The Sender argument in YOUR class events are always (as usual with Delphi) 
the instance of YOUR class handling a particular and unique connection.


Iy your sever has N connected clients, then you have N instances of YOUR 
class existing. Each one is accessible thru Client or Sender argument and 
also from TWSocketServer.Client[] indexed property.


--
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] File Sharing

2011-05-17 Thread Francois PIETTE


Hi , i want to develop a File Sharing Between Server and Client on LAN 
and

Internet ; that means the Client can download a File if he is in the same
LAN or even from INTERNET from different network .



OK Sir Francois , on a LAN i did it like this :

i created a server based on TCP Server it has 2 required options or fields
IP ADDR + PORT  so this Server is the MIDDLE MAN .
i created 2 Clients that can communicate with each other via this Middle 
MAN

, i mean the Server manages the connection between these 2 Clients .
the Client side has 1 required field PORT and an optional field IP ADDR .

and that works very well i can even transfer files between these 2 Clients 
.

the problem is with the outside network i mean connection Via Internet .


One more question: Which protocol are the client using ? After reading your 
first message, I tought you was simply using Windows networking (Network 
share) but it seems you don't. Please explain what the clients are because 
what you've done should work via an internet connection which beside speed 
is not really different from a LAN connection.


I don't completely grasp what you want to do. Do you want to create a 
peer-to-peer type application ? Please define "file sharing". Why is a 
simple FTP or HTTP server not good for you ?


--
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] File Sharing

2011-05-16 Thread Francois PIETTE

Hi , i want to develop a File Sharing Between Server and Client on LAN and
Internet ; that means the Client can download a File if he is in the same
LAN or even from INTERNET from different network .
i've been told to establish a  middle MAN using TCP so that all Clients 
can
use it as a Bridge to talk to each other and upload / download each file, 
i
did this and it succeeds on a LAN , but the problem is how could i set it 
so
that a Client from different Network can connect with these Clients , i 
mean

using Internet connection to  bridge all these Clients .


Could you first explain how you did it on the LAN ?

--
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] Questions on HtmlSmtpClient and SslSmtpClient

2011-05-14 Thread Francois PIETTE

Currently I'm using HtmlSmtpClient and planing update to SslSmtClient.
and get next questions to migrate current code to ssl.
1- with html client can be sent mail at once in html with embedded images 
and plain text. this can be done with ssl client?
2- if with ssl client only can be send as html or text and I send mail as 
html, what happen  if destination client only support plain text, who gets 
it can read the mail?


Using SSL for SMTP client doesn't change anything about what the mail is or 
can contain. SSL is used at the lowest level for transporting data. Whatever 
transport is, a SMTP mail is always the same format: a single text document. 
Even when sent as HTML with embedded images and independently of SSL, an 
email is always a simple text file. Simply, the text file is either plain 
text or text formatted a certain way named MIME to embed HTML and images. 
You should consider the SMTP client is organized with layers: a transport 
layer (itself divided in one or two layer according to the presence or not 
of SSL), a message layer (simple text lines forming a header and a body) and 
a multipart content (plain text, html and images). Each mayer make use of 
the layer below it.


Does it helps ?

--
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] Possible CliId duplication

2011-05-13 Thread Francois PIETTE

  "if FClientNum >= $7F then"
currently it wraps around after 8,388,607 


That is probably my bug, missed an F.  


Should probably be MAXINT to avoid any issue with integer size change.

--
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] Possible CliId duplication

2011-05-13 Thread Francois PIETTE

>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 huge 
file thru it). They could fill the counter and it would reset to ID 1 
which already exists.


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.


So you are right: if a client connect and stay connected for 248 days, and 
during that very long time you continuesly have 100 
connections/disconnections per second, then yes there will be a problem. In 
my opinion, this will never occur.


--
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] TFtpCli and FTP server in passive mode

2011-05-12 Thread Francois PIETTE

Hello Fabrice,


I can send you login and password to test on a private mail if you want.
This FTP server (Filezilla) work fine with a filezilla client.


I have received it and I was able to test your FTP server.
I can reproduce the error and found what the error is. It was shown in all 
your messages from start but I didn't noticed it ! The answer for PASV 
command is wrong. The answer starts with the code "27" while it should start 
with code "227".

Your server replies:
  < 27 Entering Passive Mode (213,56,128,2,5,95)
While it should reply:
  < 227 Entering Passive Mode (213,56,128,2,5,95)

The component expect response code 227 which never comes. It may work with 
other FTP client which do not check the response as ICS does. I checked with 
FileZilla client which also obviously receive the "27" response but it is 
accepted.


This is defenitely not a problem with ICS but from YOUR SERVER. You should 
find out why your server has a bad answer to the PASV command.

Maybe you have edited the the message file of your server ?

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


- Original Message - 
From: "Fabrice Vendé" 
To: "ICS support mailing" ; "Technique INFOCOB" 


Sent: Thursday, May 12, 2011 6:26 PM
Subject: Re: [twsocket] TFtpCli and FTP server in passive mode


Le 12/05/2011 17:42, Francois PIETTE a écrit :

I have tested your code and it works perfectly from here.
Here is the log using YOUR code and ICS-V7 updated form SVN repository 
right now:


I have downloaded and installed the last update 
(http://wiki.overbyte.be/arch/icsv7w.zip) on my Delphi 2010.

And I have exactly the same problem.
TftpClient.put seems to be ignored.


The differences between your test and mine are:
1) I updated my ICS source code from SVN reporistory (I mean using SVN 
client, not downloading the snapshot). Should not make any difference.

2) I'm using Delphi XE.
3) I made a small application while it looks this is part of a larger 
application.



I have just tested on Delphi XE with exactly the same result !


I'am using ICS (FTP, http and Tsmtp) components since more than 10 years
I have no problem on FTP server which allows Active mode.
This new problem is only in Passive mode.

Since something wrong from the large application could corrupt code 
anywhere, I suggest you build a new trivial application with the code and 
try it alone.


You may also try the demo application FtpTst provided with ICS.

Already tested with same problem.



Since what you want to do is so basic, it is extremely improbable that you 
found a bug in ICS. There must be something special on your computer. 
Maybe a path problem where you use an old ICS version ? Maybe some dcu 
floating around ? Also maybe there is a bug in Delphi 2010. Have you 
installed all updates ?

I have tried on Delphi 2006 and Delphi 2010 in ICS version 6 and ICS
Version 7 and last  daily Build.
On Delphi XE with last Daily build.
My Delphi 2006 and 2010 are not on the same computer. My Delphi 2006 is
on a Windows 7 pro 32 bits.
My Delphi 2010 and Delphi XE are on the same computer (Windows 7 pro 64
bits).



I have tried another way I do this :
procedure TForm8.icsClick(Sender: TObject);
begin
   FtpClient1.HostName:=site.text;
   FtpClient1.username:=login.text;
   FtpClient1.password:=password.text;

   FtpClient1.Passive:=true;
   FRunning:=true;
   FtpClient1.connect;

end;


And use event OnRequestDone :

procedure TForm8.FtpClient1RequestDone(Sender: TObject; RqType: TFtpRequest;
  ErrCode: Word);
begin

 if (ErrCode > 0) and  (ErrCode < 1) then
 begin
FlastErreur:='Requete effectuée Rq=' + IntToStr(Ord(RqType)) +
' Erreur='+ FtpClient1.ErrorMessage;
AjouterLog(FlastErreur);
 end
 else
 begin
FlastErreur:= 'Requete effectuée Rq=' + IntToStr(Ord(RqType)) +
' Erreur='+ IntToStr(ErrCode);
AjouterLog(FlastErreur);
if ErrCode=0 then FlastErreur:='';
 end;

if not FRunning then
Exit;


case RqType of
ftpConnectAsync: begin
  ftpclient1.User;
  end;
ftpUserAsync:  ftpclient1.pass;
ftpPassAsync:
begin
ftpclient1.HostDirName:='.';
ftpclient1.Cwd;
end;
ftpCwdAsync:begin
  FtpClient1.LocalFileName:='h:\test.txt';
  FtpClient1.HostFileName:='test.txt';
  ftpclient1.put;
 end;
ftpPutAsync: ftpclient1.Quit;
ftpQuitAsync: begin
  AjouterLog('Effectuée !');
  FRunning := FALSE;

Re: [twsocket] TFtpCli and FTP server in passive mode

2011-05-12 Thread Francois PIETTE

I can send you login and password to test on a private mail if you want.


OK !

Is this occuring with all FTP servers ?
And as I said before, does it occur with ICS demo ?

Send me your source code (Complete project but minimal source code to 
reproduce the issue), I'll compile and try it and will send you the compiled 
version.


--
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] TFtpCli and FTP server in passive mode

2011-05-12 Thread Francois PIETTE

When are you doing the "PUT"? In that routine after the "CWD"
Yes in the routine after the "CWD" like I do on FTP server which allows 
active mode.

I don't use Event "TftpClient.OnRequestDone".
Must I wait for something ?


No because you are using the synchronous version of the functions.
Usually ICS is used with asynchronous functions anly and then you have to 
use the events to "chain" the operations in the correct order.



I have tried to add :
while FtpClient1.State<>ftpReady do
begin
  application.ProcessMessages;
end;
After each command without better result.


Sync version of the component methods already use similar code. No need to 
add yours.


--
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] TFtpCli and FTP server in passive mode

2011-05-12 Thread Francois PIETTE

I have tested your code and it works perfectly from here.
Here is the log using YOUR code and ICS-V7 updated form SVN repository 
right now:


I have downloaded and installed the last update 
(http://wiki.overbyte.be/arch/icsv7w.zip) on my Delphi 2010.

And I have exactly the same problem.
TftpClient.put seems to be ignored.


The differences between your test and mine are:
1) I updated my ICS source code from SVN reporistory (I mean using SVN 
client, not downloading the snapshot). Should not make any difference.

2) I'm using Delphi XE.
3) I made a small application while it looks this is part of a larger 
application.


Since something wrong from the large application could corrupt code 
anywhere, I suggest you build a new trivial application with the code and 
try it alone.


You may also try the demo application FtpTst provided with ICS.

Since what you want to do is so basic, it is extremely improbable that you 
found a bug in ICS. There must be something special on your computer. Maybe 
a path problem where you use an old ICS version ? Maybe some dcu floating 
around ? Also maybe there is a bug in Delphi 2010. Have you installed all 
updates ?


--
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] TFtpCli and FTP server in passive mode

2011-05-12 Thread Francois PIETTE

I have tested your code and it works perfectly from here.
Here is the log using YOUR code and ICS-V7 updated form SVN repository right 
now:


< 220-FileZilla Server version 0.9.24 beta
< 220 Micro$oft free

USER fpiette

< 331 Password required for fpiette

PASS ***

< 230 Logged on

CWD .

< 250 CWD successful. "/" is current directory.

TYPE I

< 200 Type set to I

PASV

< 227 Entering Passive Mode (193,200,60,61,8,1)
! Upload Size 45

STOR DeleteMe.txt

< 150 Connection accepted
< 226 Transfer OK
! 45bytes received/sent in 62 milliseconds

QUIT

< 221 Goodbye

Regards,
--
francois.pie...@overbyte.be
http://www.overbyte.be


- Original Message - 
From: "Fabrice Vendé" 

To: 
Sent: Tuesday, May 10, 2011 11:49 AM
Subject: [twsocket] TFtpCli and FTP server in passive mode



Hello,

I have a problem to upload a file on some server which are only reachable 
in passive mode.
Tested with a lot of version of ICS (V7, octobre 2010, V6 octobre 2009) 
and on Delphi 2006, 2007, 2010.


In passive mode with Ftpclient.passivemode:=true; command "put" (same with 
"get") seems to be ignored.


I only do this :
procedure TForm8.icsClick(Sender: TObject);
begin
   FtpClient1.HostName:=site.text;
   FtpClient1.username:=login.text;
   FtpClient1.password:=password.text;


   FtpClient1.connect;
   FtpClient1.HostDirName :='.';
   FtpClient1.cwd;


FtpClient1.LocalFileName:='h:\test.txt';
FtpClient1.HostFileName:='test.txt';

FtpClient1.TypeBinary;

FtpClient1.Passive:=true;
FtpClient1.put;
FtpClient1.Quit;

end;

Log returned by TFtpClient (useing TftpClient events) is :

< 220-FileZilla Server version 0.9.37 beta
< 220-written by Tim Kosse (tim.ko...@gmx.de)
< 220 Please visit http://sourceforge.net/projects/filezilla/
USER auser
> USER auser
< 331 Password required for auser
PASS apass
> PASS apass
< 230 Logged on
CWD .
> CWD .
< 250 CWD successful. "/" is current directory.
TYPE I
> TYPE I
< 200 Type set to I
PASV
> PASV
< 27 Entering Passive Mode (213,56,128,2,4,27)
QUIT
> QUIT
<
221 Goodbye


In active mode without the line "FtpClient1.Passive:=true;" I Have :


< 220-FileZilla Server version 0.9.37 beta
< 220-written by Tim Kosse (tim.ko...@gmx.de)
< 220 Please visit http://sourceforge.net/projects/filezilla/
USER auser
> USER auser
< 331 Password required for auser
PASS apass
> PASS apass
< 230 Logged on
CWD .
> CWD .
< 250 CWD successful. "/" is current directory.
TYPE I
> TYPE I
< 200 Type set to I
PORT 192,168,1,13,195,101
> PORT 192,168,1,13,195,101
< 200 Port command successful
! Upload Size 2,08K
STOR test.txt
> STOR test.txt
< 150 Opening data channel for file transfer.
< 425 Can't open data connection.
! STOR Failed
QUIT
> QUIT
< 221 Goodbye


I get an error 425 "Can't open data connection." !

So how to set passive mode and upload a file ?
What I have missed ?
Command like FtpClient1.dele works fine

This FTP server work fine with a Filezilla client.

Best regards,

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


Re: [twsocket] Computer's name

2011-05-11 Thread Francois PIETTE

"
Your second message comes later and is available from the OnDataAvailable
event handler at server side."

Is it possible to send this at the same time as it connects?


No. The client can only send data when the TCP session is established and 
your first message is generated at server side form TCP session information.



What I need is,
to combine both messages and get the ID and computer name.


You can combine it when the message comes from the client. I don't see where 
the problem is. Or maybe there is something I misunderstood.



"
You should store this per client information in the TTcpSrvClient class
(just add new members as you need). As long a the connection is alive,
TTcpSrvClient class instance will hold any value you store in it. In all
events the "client" argument point to the same instance."

I am not sure if understand this but?
I have an xml which is kind of database where I would like to keep the 
computer data and refresh the data everytime I get the "KEEPALIVE" message 
from the client which will tell me that client is working. Client is 
sending the keepalive data by informing it's name and from the name I will 
know who is alive and who is dead.


It will be easier for me if I could just combine the messages and insert 
the data into the xml because I don't know how to store the data in 
clientclass.


In the ICS demos, there are examples. If I remeber well, the demo simply 
record the datetime of connection.


--
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] Computer's name

2011-05-11 Thread Francois PIETTE

First,
Server gives info of connected client with it's ip and the ID, the ID is 
very important for me because I need to use it for sending commands to the 
client.


Second,
Client sends a message where it tells it's name etc. when it is connected. 
I push client to send message to the server with lot of info.


What I would like to do is,
to combine these 2 messages together where I could get the ID and the 
computer name with all the other info I need from the client.

Is it any possible to do this?


If I understand correctly, what you name your first message is not really a 
message, it is just the event triggered at server side when a client is 
connection to the server. At that time, the client has still not send 
anything.


Your second message comes later and is available from the OnDataAvailable 
event handler at server side.


You should store this per client information in the TTcpSrvClient class 
(just add new members as you need). As long a the connection is alive, 
TTcpSrvClient class instance will hold any value you store in it. In all 
events the "client" argument point to the same instance.


--
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] Computer's name

2011-05-11 Thread Francois PIETTE

I hope I have explained okay.


I do not grasp your complete architecture.
Which programs are you writing ? A server, a client, both ?
What is the ID you are talking about ?
Which protocol are you using ? You own ?

--
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] EmulVT bugs...

2011-05-10 Thread Francois PIETTE

Hello Alistair,

If you are going to fix the bugs you've found, please be absolutely sure to 
start with the latest version of the entire ICS. For that, download it from 
the SVN repository. See instructions there: 
http://wiki.overbyte.be/wiki/index.php/ICS_Download

Once fixed, email me the complete files you've updated.

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


- Original Message - 
From: "Alistair Ward" 

To: 
Sent: Wednesday, May 11, 2011 7:05 AM
Subject: [twsocket] EmulVT bugs...



Hi,

I've just downloaded ICS as I need a telnet client with a COM interface 
and

haven't found one that works well enough for me yet (so I'm going to write
one...)

I'm in the process of extending the EmulVT component to support xterm
emulation. In the process I have identified 2 bugs in the core vt100
emulation:

1) Reverse Video

At the end of ProcessCSI_m_lc, the foreground and background colours are
swapped if the FReverseVideo flag is set. This is incorrect. The actual
attribute to use needs to be calculated in WriteLiteralChar.

Consider the following sequence:

[0;7m[31m[40m

The current implementation will not handle this correctly.

2) Graphics (line drawing) characters

Line drawing characters are done by switching character sets and 
performing

a translation. The translation should *not* be done if we are currently
processing an escape sequence.

Consider the following sequence:

[0;7m(0[31m[40m

The current implementation does not do the colour change as the 'm' has 
been

translated to a line drawing character.

The character sequences above are captured from a Linux app using ncurses

--
Alistair Ward
Senior Software Engineer
Noel Leeming Group

Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of Noel
Leeming Group Limited.  This e-mail message and any accompanying data may
contain confidential information.  If you are not the intended recipient,
you are notified that any use, dissemination, distribution or copying of
this message or data is prohibited.
--
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


Re: [twsocket] Computer's name

2011-05-10 Thread Francois PIETTE
We can get some remote info of the connected client from the following 
code but,

are there any possibilities of getting the computername as well?


Are you asking about Windows networking "computername" ? This is completly 
independent of the TCP/IP protocol. It may even be different that the DNS 
name associated with the computer's IP address.


if the remote computer is on the same LAN (or WAn transporting Windows 
networking), then Windows API has function to enumerate computers on the 
network (this is what Windows Explorer uses to show the network 
neightborhood). You may use that API into your application.


--
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] Very Strange PHP Proxying Issue

2011-05-03 Thread Francois PIETTE

Is there any way to set a default value to a parameter in Delphi? In C++
it's like (in .h or .hpp header file)

void function(int param = value);
so the function can now be called as function() without the requirement of
expicit param specification.


Same in Delphi.

--
francois.pie...@overbyte.be
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] Connected when not connected

2011-05-03 Thread Francois PIETTE

So how should I handle connection errors in a way that makes user aware of
error AND not cause any kind of disaster? Catch the error code in
OnSessionConnected


Yes, indeed.


and (using some kind of PostMessage) display actual error
message outside OnSessionConnected?


If you like it so, no problem.
Remember that the statsu won't change automatically if no trafic take place. 
So you may well display "connected" while the connection is broken (typical 
example: cabke unplugged). The only way to make sure you have the real 
status of the connection is to periodically make some traffic. This is the 
only reliable way doing it. Winsock keepalive packets are not reliable at 
all as my experience shows.


--
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] Connected when not connected

2011-05-03 Thread Francois PIETTE

This is how winsock works. OnSessionConnected is fired with an error,
after it OnSessionClosed is fired with or without an error.


So having TWSocket's state different from actual state should be 
considered

normal? If so, then I understand that checking for component state is NOT
enough to check whether it is actually connected or not?


Well, you should probably consider you are connected with error. The error 
code being available thru the OnSessionConnected event.


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

2011-04-29 Thread Francois PIETTE

OK.

--
francois.pie...@overbyte.be
http://www.overbyte.be

- Original Message - 
From: "Arno Garrels" 

To: "ICS support mailing" 
Sent: Friday, April 29, 2011 7:53 PM
Subject: Re: [twsocket] Bomb



Anton S. wrote:

Actually it could be replaced by {$MESSAGE FATAL 'Wrong defines'}


Agreed, the MESSAGE directive is supported since at least D7 and ICS 
already uses it at some places.


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


Re: [twsocket] Bomb

2011-04-28 Thread Francois PIETTE

Hi Francois,
I understand it now.
I didn't get the idea in the first place :(
I tought it should be somehow different and need to be placed in the 
code..


When a symbol impact a lot of units, it is more convenient to set it at the 
project level so that it is really global. This is specially required if a 
unit may be part of several projects but using different values for the 
symbol according to the project. In that case you have no other choice than 
set it in the project options.




Sorry for the trouble.


No problem, you're welcome.

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

2011-04-28 Thread Francois PIETTE

You have to define use_ssl on your project option and rebuild all.



How do I do this exactly?
I am not sure if understand what i need to do.


Delphi menu / Project / Options / Delphi Compiler / Conditional Definitions 
(May vary according to Delphi version)

then add USE_SSL after the existing if any.

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

2011-04-27 Thread Francois Piette
You have to define use_ssl on your project option and rebuild all.
-- 
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.


daniel cc  a écrit :

Hi Francois, Thanks for the response :) Do I need to do anything, define 
anything? I am using the SSL socket.. Thanks in advance -Original 
Message- From: Francois PIETTE Sent: Thursday, April 28, 2011 8:45 AM To: 
ICS support mailing Subject: Re: [twsocket] Bomb > Could someone please 
explain, > what this means? > >  The code in the unit where such line is included is 
intended to be compiled using the USE_SSL symbol defined at the project level. 
The line is there to trigger a compilation error should the user forgot to 
define the symbol. -- 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 -- 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

Re: [twsocket] Bomb

2011-04-27 Thread Francois PIETTE

Could someone please explain,
what this means?




The code in the unit where such line is included is intended to be compiled 
using the USE_SSL symbol defined at the project level. The line is there to 
trigger a compilation error should the user forgot to define the symbol.


--
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] XML RPC

2011-04-21 Thread Francois PIETTE

It's unfortunately an existing API I need to interface with.


No problem. As usual with XML, be prepare to have CPU and memory hungry 
piece of code.



The encoding is
Base64, so I'll need to find a delphi lib to get it back to regular XML.


ICS has the functions to encode and decode base64.


I was hoping for some autmation with the process, but looks like it's
going to be a few late nights.


Use Delphi RTTI for that purpose.

--
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] XML RPC

2011-04-21 Thread Francois PIETTE

Just a quick question. I need to interface to a XML RPC API, but I havent
got the foggiest were to start. Could the ICS possibly assist?


XML RPC is a remote procedure call (RPC) protocol which uses XML to encode 
its calls and HTTP as a transport mechanism. "XML-RPC" also refers 
generically to the use of XML for remote procedure call, independently of 
the specific protocol.


ICS can help because the transport layer (HTTP) is already there for client 
and server side.


Where to start ? Look here: http://en.wikipedia.org/wiki/XML-RPC
Once you understand the XML formatting, you use ICS to transport it.

by the way, unless XML RPC is a requirement, there are much efficient ways 
of doing the same thing. One of the many is by using my other component 
library named MidWare (See my website).


--
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] socket lossing traffic after 2/3 days

2011-04-19 Thread Francois PIETTE
Am running a chat system using tcp for data transfer but I have a problem 
am unable to fix and was wondering if anyone else had this issue.


basically when using my app for more then 3 days it would cash but not a 
full socket crash were it would boot people it would just stop accepting 
new incoming data from logins but anyone else that was already connected 
would not be effected at all until there log off site and turned to 
re-login then there would get connecting fail message



It looks that the listening socket is closed.
At the command prompt, enter "netstat -p tcp" (without quotes). You should 
see your listening port.


--
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] UDP receive issue from a Windows service

2011-04-19 Thread Francois PIETTE

While testing, I also had during some time FD_READ triggered but
ReceiveFrom returning -1.


Isn't that quite common, if those are WSAEWOULDBLOCK errors?


As far as I know, not so much. I saw is returning -1 during 4 seconds which 
is the timeout time in my appication.


--
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] UDP receive issue from a Windows service

2011-04-19 Thread Francois PIETTE

GDisplayProc is assigned a routine which output the message to the
console window and to the log file and which is used all over the
application.

Guess what ? It works !
This is not satisfying since the log file is full of unwanted
messages and this probably only hides the real problem.


Does that mean notification from winsock works however the call to
ReceiveFrom fails or doesn't return data?

Or does it receive data with this extra logging?


It receive data.
While testing, I also had during some time FD_READ triggered but ReceiveFrom 
returning -1.


--
francois.pie...@overbyte.be
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] UDP receive issue from a Windows service

2011-04-18 Thread Francois PIETTE

Actually the service is a dual mode service/app console and it works
perfectly well as a console application (and also as a service when a
debugger is attached).



I do not understand the 'dual mode' but could that be a reason?


A dual mode service is an application which detect if it run as a service 
application or as a normal console application and take appropriate action 
according to the context. This is very handy for debugging.


What happens if you put your application into 1 object (no console 
interaction), then

create/run it in a console application then create/run it in a NT service
application?


This require a lot of work. I will do if I can't manage to make it work in 
dualmode.


--
francois.pie...@overbyte.be
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] UDP receive issue from a Windows service

2011-04-18 Thread Francois PIETTE

Seriously, what happens if you run the console application as a
service with my NT Wrapper http://www.duodata.de/ntwrapper/?


It will surely not work because my code for dual mode will be fooled, 
thinking it is a service application while it is not.



If that works I guess the problem can be found in your service code,
assuming that you neither use the Delphi service framework nor
my DDService (http://www.duodata.de/misc/delphi/DDService.zip).


I use my own code I wrote years ago. I use it in several applications (but 
none with UDP until now) with no problem.




I have tryed something new and simple: I derived a new class from TWSocket 
and overriden TriggerDataAvailable. My idea was to know if it was triggered 
or not. Here is the code:


type
   TDebugWSocket = class(TWSocket)
   protected
   functionTriggerDataAvailable(Error : Word) : Boolean; override;
   end;

var
   GDisplayProc : procedure (const Msg : String) of object = nil;

function TDebugWSocket.TriggerDataAvailable(Error: Word): Boolean;
begin
   if Assigned(GDisplayProc) then
   GDisplayProc('TriggerDataAvailable');
   Result := inherited TriggerDataAvailable(Error);
end;

GDisplayProc is assigned a routine which output the message to the console 
window and to the log file and which is used all over the application.


Guess what ? It works !
This is not satisfying since the log file is full of unwanted messages and 
this probably only hides the real problem.


--
francois.pie...@overbyte.be
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


  1   2   3   4   5   6   7   8   9   10   >