Re: [twsocket] FTP and Memo - LogText?

2013-05-30 Thread Angus Robertson - Magenta Systems Ltd
> Noticed odd bug in the FTP Transfer program. 
> I used OverbyteIcsSslFtpServ.exe on another machine 

The bug is in the ICS FTP server, with the new XDMLSD directory listing
command, that is only likely to be used by the ICS FTP client.

> < 192.168.0.33 XDMLSD -R
> > 192.168.0.33 226 File sent ok
> > 192.168.0.33 451 Failed: Access violation at address 004B9E39 in 
> > module 'OverbyteIcsSslFtpServ.exe'. Read of address .

I saw the bug myself last week when testing the latest version of the ICS
Xfer components, that now support improved progress information with
duration estimates and ignore sub-directories.  So far I've only updated
the v3W components for Delphi 2007 (which I used for all my own
applications), not the normal v3 components for D2009 and later, will do
that next week. 

> XDMLSD -R
> Failed to compress file - Access violation at address 005315ED in
> module 'magfserver.exe'. Read of address 

and

> XDMLSD -R
> Using thread to list directory
> Directory 0bytes sent in 0 milliseconds
> Unhandled Server BgException: Thread Error: The handle is invalid (6)

The server bug is something to do with the thread that is used for the
directory listing and compressing the result, I've seen different errors,
and sometimes it works once and then fails.  Not been able to reproduce
it under the debugger yet, will try again next week, busy this week.  

In the client, you can set magftpNoFeat in MagFtpOpts to stop the
advanced commands being used. 

Angus

-- 
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] best practice for upload status

2013-05-30 Thread Angus Robertson - Magenta Systems Ltd
> Previous advice worked (NoFeat) thanks.

I would only do that if testing against the ICS FTP server, other FTP
servers (and ICS) provide better file listing commands that use some
'features'.  

> What would be the simplest method to track how many bytes/files 
> have been uploaded/downloaded. Checked the CopyEvent but cannot
> understand exactly when to trap the details ?

As I said before, the current event only passes formatted strings with
progress information, the display of which has been sufficient for the
last 10 years in my applications.  

You'll need to wait another week for the new version that passes a
structure with about 20 different file and session progress elements you
can freely display as you wish. 

Angus

-- 
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] FTP and Memo - LogText?

2013-05-30 Thread Angus Robertson - Magenta Systems Ltd
> *Subject:* Re: [twsocket] FTP and Memo - LogText?
> > The server bug is something to do with the thread that is used 
> > for the> directory listing and compressing the result

> I guess that code added after V1.46 to the worker thread is not 
> thread save. Or that calls from the events that trigger in worker
> thread context are not safe etc..

I suspect the bug is related to listing parameters, I download and upload
stuff to my public server dozens of times a day, always using the XDMLSD
command, the bug only seems to happen when listing the root directory,
but does have some randomness to it, otherwise I've have seen it ages ago.
It just got pushed back in my job queue because no-one else reported it,
until today.  

Angus


-- 
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] Postings to the list requires new address?

2013-05-30 Thread Angus Robertson - Magenta Systems Ltd
> > Looks like  does no longer work
> > however  does.
 
> If you see this I was wrong.

That message did appear, so it seems both email addresses work, I've had
to change my email client filtering to get all twsocket related emails to
appear in the correct folder. 

The twsocket archives seem to be available again, so it seems elists is
finally working again after 10 days down unannounced downtime. 

Angus

-- 
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] FTP component not ready

2013-06-10 Thread Angus Robertson - Magenta Systems Ltd
> As far as I know, using the Async commands, the "FTP component not 
> ready" error occurs if you initiate a command before the previous
> one has generated the RequestDone event.

Yes, the State variable is checked to ensure the next command can be
performed safely. 

> I have one customer who is getting this error about
> once a week, so the question is:  Can this error be produced by
> something else. A network error or  some strange issue in the
> server maybe?

State can change at any time while a command is being executed and
sometimes two or more commands are executed in sequence.  State changes
to ftpNotConnected when the control channel disconnects, which will cause
the not ready error when the next command is executed. 

Angus

-- 
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] FTP component not ready

2013-06-10 Thread Angus Robertson - Magenta Systems Ltd
> Ok, so what I am trying to establish is that it must be my software 
> that is causing the problem.

I didn't say that, it's probably the control channel dropping, either a
network problem or the server disconnecting the session. 

> There must be some sneaky situation where I am
> triggering a new command before the previous one has finished.

I said some methods trigger more than one command, the various Connect
methods use a sequence of commands, and all upload and download methods
do PORT or PASV before GET or PUT.  So the not ready error can occur
during any of these commands.  

I'm not sure what your original problem was, error handling is something
necessary for all network applications, networks die.

Angus

-- 
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] FTP component not ready

2013-06-10 Thread Angus Robertson - Magenta Systems Ltd
> I ran into a similar problem while testing some of my software. 
> After a couple of days of pulling my hair out, I thought to change 
> out my router and the problem disappeared. I never did determine 
> what was wrong with the router.

Many routers support NAT, which is quite messy for the FTP protocol which
have connections coming and going on different ports, which the router
has to keep track of, sometimes modifying the control channel protocol to
correct the IP address from internal to external, or vice versa.  This IP
translation is why many sites suggest using Passive mode so only outgoing
connections are made, but a 'real' router will do non-passive properly as
well. 

All this processing can be too much for some NAT routers, particularly
cheap ones (like Netgear) designed when internet connections were lovely
and slow and an underpowered box got away with it. Put a cheap box on a
120 meg cable modem and it will probably limit your speed and introduce
strange bugs.  

Hardware firewalls are even worse, since they check every packet passing
through against massive lists of threats, and it needs a beefy processor
to keep up with modern speeds.  I buy a new Sonicwall firewall router
every couple of years to try and keep up with internet speeds, but even
my latest TZ215 with gig ports can not offer the same speed as my cable
modem. 

Angus

-- 
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] FTP component not ready

2013-06-10 Thread Angus Robertson - Magenta Systems Ltd
> The original problem is that the "FTP component not ready" just 
> turns up very occasionally from doing a series of getAsync commands.
> So assuming that the error might be from a PORT or PASV, should the 
> sequence of events I take be to call ftp.Abort followed by some
> sort of restart of my state machine. 

Yes, if you look at my TMagFtp high level component (sync only, but using
threads if you really want parallel transfers) you'll see a vast amount
of error handling, including repeating the whole job X times if it fails.


This was all from long experience on poor internet connections, dial-up
in the old days, although the internet is much better now.  

> I assume the FTP component will still be connected  or this
> not necessarily the case.

You should check the Connected property before every command and abort if
the connection is lost.  

Angus

-- 
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] Magenta Systems File Transfer Components v4.1 for ICS V8

2013-06-12 Thread Angus Robertson - Magenta Systems Ltd
There is a new release of the TMagFtp and TMagFileCopy components for ICS
V8 today, that may be downloaded from: 

http://www.magsys.co.uk/delphi/magxfer.asp

Main changes are as follows, also XE4 packages added:

Added IgnorePaths to SelectCopyFileList and TMagFileCopy to ignore files
where source has specific partial path, list is
c:\temp;c:\temp2\;c:\temp3\;etc, or destination for deletion matches
partial path.

Added Wow64RedirDisable property for Win64 allow all files to be copied
correctly from Win32.

Added new ProgressEvent which passes TCopyProgress record updated for
progress of current file and session including total bytes copied
allowing percentage progress display.

Using TMagStringBuild to build listings instead of TMemoryStream.

When checking copy, use TMagStringBuild for improved listing performance.

Default to allowing IPv4 or IPv6 host names.

Demo3 application updated with 'Show Extended Progress' to demo the new
progress event (but you could use a progress bar), 'Ignore Directory' and
'Disable WOW64 Redirect' for TMagFileCopy and TMagFtp.

Executable demos are included for demo purposes. 

Angus

-- 
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] HTTP server keep-alive timeout aborts GET request

2013-07-02 Thread Angus Robertson - Magenta Systems Ltd
> This works as long as the connection is'nt idle for longer than the
> value configured in KeepAliveTimeSec (which defaults to 10 sec). In 
> that  case the connection is terminated by the server 

Never really looked at KeepAlive.  From the naming it sounds like a means
of keeping an idle connection open, but in practice seems to be
implemented as an idle timeout, and 10 seconds is very short for such a
timeout. 

I'd suggest changing the default to a minimum to one minute, or even more.


However there seems to be a Connection: Keep-Alive header involved as
well, not sure how the timeout and header interact. 

Angus

-- 
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] HTTP server keep-alive timeout aborts GET request

2013-07-02 Thread Angus Robertson - Magenta Systems Ltd
> I don't think so. According to a short test it seems that the idle 
> timeout is usually even lower.

Presumably you mean timeout is much higher, ie 5 mins for Apache?

Currently, our KeepAlive only checks the last send (in RealSend) or
received (DoRecv) and ignores whether the stream has been completely sent,
which I assume is your original problem.  

The connection will only stay open for HTTP/1.1, and presumably you want
the 10 second timeout to only be effective at that point? 

Angus


-- 
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] HTTP server keep-alive timeout aborts GET request

2013-07-02 Thread Angus Robertson - Magenta Systems Ltd
> When looking at the code it seems I could use TCustomTimeoutWSocket
> properties to get the I/O timeout of 5 minutes. What is missing is 
> to restrict the KeepAliveTimeSec-timer in
> THttpServer.HeartBeatOnTimer from triggering when some data
>  transfer is in progress.

It will need a new idle timeout property TimeoutSecsXfer to be compatible
with the FTP server, which can be checked in HeartBeatOnTimer without
needing TCustomTimeoutWSocket. 

> - should I perform the changes locally in my own code or is it 
> useful to include them in upstream ICS?

Yes, make sure you have the latest server v8.04, email the complete unit
to me for testing and I'll add it to SVN once I've updated by live web
server. 

> should I add a new connection state "hcIdle" for it 

Yes, a new THttpConnectionState makes sense, but do check the code
carefully to see what else is dependent upon it. 

Angus

-- 
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] HTTP server keep-alive timeout aborts GET request

2013-07-03 Thread Angus Robertson - Magenta Systems Ltd
> On a second look the existing "hcRequest" state seems to be the 
> state that I
> am searching for: the server socket is waiting for new requests. My
> question is, why is the state not automatically reset after 
> "hcSendData" back to "hcRequest"?
> As the last changes in this area have been made by Arno 

I added hcSendData a year ago, because initially the state was reset to
hcRequest before any data was sent, which caused a problem when blank
lines were sent after a request.  

State is not currently changed when a request ends because it's not
necessary as part of the state mechanism.  

Angus

-- 
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 sending large block of data

2013-07-03 Thread Angus Robertson - Magenta Systems Ltd
> I've used TWSocket/TWSocketServer to build client/server 
> successfully in the past.  Now I have one where I need to send a
> 20MB block of data from server to client. 
> it is my understanding that TWSocket is built to handle this
> situation

Not sure why you expect to send a single block 20MB in size, none of the
ICS high level components or demos attempt to do that.  64K is about the
maximum block size sent. 

Normally you use the OnDataSent event to send the next block of data, as
illustrated in numerous components.  It is not much more effort, you just
need to keep track of how much you have sent so far.  

Angus





-- 
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 sending large block of data

2013-07-03 Thread Angus Robertson - Magenta Systems Ltd
> Looking at TWSocket code, I don't see why one could not send 20MB 
> in one chunk

I try to avoid the low level winsock stuff, but I do know that
TIcsBufferHandler is used to store everything before it is sent, each
buffer is 1460 bytes (TCP packet size).

So your application would be allocating 13,700 linked buffer pages before
anything was sent, which is quite an overhead, and something the unit was
never designed to handle. 

Angus

-- 
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] HTTP server keep-alive timeout aborts GET request

2013-07-05 Thread Angus Robertson - Magenta Systems Ltd
> Attached is a patch file to highlight my changes

I asked you to email it privately, most of the hundreds on the mailing
list won't need it, also attachments are usually stripped. 

Angus

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

2013-07-05 Thread Angus Robertson - Magenta Systems Ltd
> hi, i'm using Twsocket and ics component on delphi xe4, i wanted to 
> know if some one had a demo example that explain how to send and 
> receive image from the client to the server 
> (Timage-->stream-->Timage) through UDP. Thanks in advance

Generally not a good idea to use UDP for sending data larger than about
1,400 bytes.  

UDP has no concept of a stream, and no error correction or checking,
packets may get lost and you don't know they are missing, unless you
define yourself an error correcting protocol that will resend lost
packets and split and recombine them.  Except someone did it already, and
it's called TCP.

So TCP is now you send images. 

Angus

-- 
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] Updates for HTTP client and server

2013-07-12 Thread Angus Robertson - Magenta Systems Ltd
The overnight V8 zip has changes for HTTP client and server.  

Log: OverbyteIcsHttpSrv.pas

Jul 11 2013 V8.05 Angus
Tobias Rapp found that client requests timed out after 10 seconds
inactivity due to KeepAliveTimeSec which is far to fast.

So added KeepAliveTimeXferSec default to 300 seconds which is effective
during transfers, with KeepAliveTimeSec being used between requests.

Ignore blank line separating pipelined requests


Log: OverbyteIcsHttpProt.pas

Jul 11, 2013 V8.04 - Angus
Changed default Agent to 'Mozilla/4.0' removing (compatible; ICS) which
upset some servers

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

2013-07-18 Thread Angus Robertson - Magenta Systems Ltd
Is there an easy way to support SSH for ICS?  Just need secure telnet to
a 30 year old Unix application. 

I've looked at the OpenSSH pages, but this seems to be tools rather than
APIs.   I understand the OpenSSL DLLs provide all the encryption needed. 

Has anyone tried to use SSHTNEMULVT from the Usermade page with recent
versions of ICS? 

Angus

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

2013-07-18 Thread Angus Robertson - Magenta Systems Ltd
> I do not think so. Last year I wrote a very simple
> Putty-wrapper in order to be able to get a directory listing

Thanks, just been playing with putty, it will connect to the Unix system,
but the tunnelling does not seem to work with the application that does
not support SSH.  

The application was written 20 years ago in C and is very hard to
maintain, the author moved to Redmond for many years (MSIE) but is now
back trying to add SSH.

I suggested a proxy/tunnel would be quickest, if someone has done it
already, no need for me to write something.

Angus

-- 
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] FTP client sync functions bug

2013-07-26 Thread Angus Robertson - Magenta Systems Ltd
The overnight ICS V7 and V8 zip files have a FTP client fix for a long term bug
that may effect any applications using certain synchronous functions that use
multiple FTP commands in sequence.  From SVN: 

Fixed bug in WaitUntilReady that meant some sync methods with multiple
commands randomly terminated prematurely allowing further commands to be
sent usually resulting in not ready errors. This showed up in failed
resumed uploads, but could have been the reason by other unexplained not
ready errors.

Note this bug specifically effects the TMagFtp high level components which use
sync methods, and have a modified version of WaitUntilReady that also needed
fixing, 4.1 is available from:

http://www.magsys.co.uk/delphi/magxfer.asp

Thanks to Allan Fernandes for finding a reproducible case for this bug. 

Angus


-- 
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] Not all data sent via THTTPServer being received in Chrome, Firefox, RESTClient

2013-08-07 Thread Angus Robertson - Magenta Systems Ltd
> I call SendStream() on the connection having created the full 
> DocStream

It is usual to set the stream, then:

Flags = hgSendStream

so the component does the hard work.  

> To be honest I don't know (am struggling to assert) whether the
> data is being gzip or not before it is sent. 

Gzip is only supported if Server Options includes hoContentEncoding, and the
result is within the size limits allowed, not too small or large. 

Use the event ContentEncode to check if the content is being compressed, you
can do it yourself by sending a pre-compressed file. 

Angus

-- 
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] Implementing Push Notifications to Custom Clients

2013-08-09 Thread Angus Robertson - Magenta Systems Ltd
> We want to implement something like push notifications to custom 
> applications from our backend server to custom clients.  

To an extent, this depends on how many clients are connected, since servers
have limits.  

If low, you can keep TCP/IP connections open and just design your own protocol
to send packets of data back and forward between client and server.  I designed
a simple ASCII protocol with 50 different messages.  

For thousands of clients, you may be better have the clients regularly polling
every few minutes, or send a UDP message to ask the client to poll, or a mix of
the two.  This is what I used for a large client application.  

Angus

-- 
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] Implementing Push Notifications to Custom Clients

2013-08-09 Thread Angus Robertson - Magenta Systems Ltd
> Would "keep TCP/IP connections open" be the same as persistent 
> connections?

Yes, although TCP/IP itself does not have a mechanism to confirm a connection
is still open, except possible keep alive packets.  Normally you only find out
a connection has disconnected when trying to send something, and getting a
timeout error.  

It's best for your protocol to send a packet back and forward every minute or
two, so both ends know the connection is alive.  My large application updated a
SQL database with this, and had web pages to review which clients were online.
The keep alive packet also sent the server time to ensure clients were
synchronised, and the client sent back status information, temperatures, etc. 

When dealing with large number of connections, apart from server memory, you
may have firewall issues, you have to think big. 

BTW, there are several client/server samples, but start with  OverbyteIcsTcpSrv
and OverbyteIcsCliDemo, or use my 'IP Log Streaming Component' from:   

http://www.magsys.co.uk/delphi/magics.asp

which should allow you to prototype something in a couple of hours. 

Angus

-- 
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] mlsd and modified data

2013-08-23 Thread Angus Robertson - Magenta Systems Ltd
> I'm using the FTP Client component to get some file data from our 
> Dreamhost FTP server.
> I'm using the MLSD command, but I've noticed that the modified 
> value for a file isn't always the same e.g
> Running on two different machines gives two different values
> 
> modify=20130803144603
> modify=20130802184455
> 
> Is this value generated solely by the server or does the FTP client 
> component modify it to take maybe time zone in to account ?

That text is an extract from a complete FACTS line for a file as returned by an
FTP server, the ICS FTP client simply returns a text string of the complete
line and your application has to parse the dates.

MLST snmp trap-20130823-00.txt
 size=0;type=file;perm=fdrwa;create=2013082223;
 modify=2013082223; snmp trap-20130823-00.txt
250 END

According to the RFCs, these dates should always be UTC, which is convenient
for us European developers, but some Americans don't understand UTC and may
return local time instead, specifically WS_FTP Server did when I tested it
several years ago.  But that does your explain your difference, since the time
is different as well. 

Angus


-- 
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] mlsd and modified data

2013-08-23 Thread Angus Robertson - Magenta Systems Ltd
> I'm assuming you mean local to their server, rather than local to 
> the client ?

Yes, the FTP has no knowledge of the client's time zone. 

> What's also odd is that mlsd from one client results in the files 
> returned in a different order than another client - I'd have 
> expected that the server would always use the same sorting criteria.

Assuming you mean the same client software on different PCs against the same
server, the results should always been the same.  

But some FTP applications may sort the file in client and present them in a
friendly manner.  

The order on the server may also change as files are deleted and added. 

If you use my TMagFTP component, the directory will be returned as sorted
Delphi records.  

Also beware that lots of date fiddles are needed for FTP, for instance UNIX
does not return the time of day for files older than a year, and servers
returning local time often return summer time and winter time, so change the
time stamp twice a year.  

You learn all these things after massive downloads.  TMagFtp defaults to
assuming any file with a time stamp within 62 minutes is the same

Angus

-- 
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] SMTP server component

2013-08-27 Thread Angus Robertson - Magenta Systems Ltd
I have a project coming up that will need an SMTP server component, listening
on port 25 and accepting incoming emails, one high level component that ICS
currently lacks.  

Ian Baker of Codecutters contributed an open source SMTP server component 10
years ago, as did Sven Schmidts of Concept Design.
Has anyone kept these up to date with ICS, and perhaps added SSL support?

Whatever I produce will end up as supported ICS components.  

Angus

-- 
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] TPing, PingThrd1...

2013-09-03 Thread Angus Robertson - Magenta Systems Ltd
> Using the PingThrd1 example I set the timeout and it does not make 
> any difference when the no response error message arrives.

Where did you find that example?  Was that some I wrote 10 years ago? 

The ICS demo is OverbyteIcsPingTst1, and the ICS V8 version of ping now
includes TPingThread. 

The timeout is simply the maximum period the thread will wait for an ICMP
response before exiting. 

Timeout has nothing to do with DNS look-ups, they have a much longer timeout
set by the OS. 

Angus



-- 
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] TPing, PingThrd1...

2013-09-03 Thread Angus Robertson - Magenta Systems Ltd
> *Subject:* Re: [twsocket] TPing, PingThrd1...
> Well it seems the timeout has zero effect.
> Setting it to any number does not change the result.

I was wrong before, the timeout relates to the Windows ICMP blocking request,
as does the resulting reply in ms.  

Are you getting the same result from every public IP address you test,
including non-existent addresses, or just one single IP. 

> The project is named PingThrd.
> FPing := TPing.Create(nil);  // create in thread context

That is a very old project and like all usermade source code, is unsupported.
The threaded version has not used TICMP not TPing for 12 years.  

The last version is at: 

http://www.magsys.co.uk/download/software/pingthrd.zip

but that is also unsupported since ICS V8 now includes a threaded ping.

Angus




-- 
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] Access denied issue

2013-09-03 Thread Angus Robertson - Magenta Systems Ltd
> I'm using the FTP client component in my app to login to my public 
> FTP site and download some files.
> This seems to work well for almost all my customers, but one is 
> getting a '550' access denied message.

The error is happening with the MSLD command which needs to open a data
connection, which is where there can be fun with NAT routers that need to
change the data connection IP address. 

Worth reversing passive mode to see if that makes a difference. 

Angus

-- 
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] Access denied issue

2013-09-03 Thread Angus Robertson - Magenta Systems Ltd
> Thanks. slightly different if PassiveMode = FALSE, but no cigar :(
> 09:13:40:776 LastResponse was : '502 Active FTP not allowed.'

Unusual to see an FTP server specifically refuse non-passive connections, do
you know what make? 

Unfortunately you won't get much further without seeing the actual FTP commands
received by the server, as modified by the NAT router, and even then there is
not much you can do.  

Maybe ask your client to try accessing a different public FTP server, like mine
at ics.ftptest.org, to see if it all FTP servers are being blocked or just this
one, I can look at the ICS FTP server logs.  

Angus

-- 
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] TPing, PingThrd1...

2013-09-03 Thread Angus Robertson - Magenta Systems Ltd
> I was just testing one internal IP address to a computer that is 
> turned off.
> Maybe I am doing something wrong but just setting the timeout does 
> not alter any test.

You mean it does not alter in a test to a single IP address. 

Timeout has always worked for me in numerous applications, on numerous versions
of Windows, just check the Trace Route demo application in the zip I mentioned
before, where timeout can be set. 

Angus



-- 
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] Access denied issue

2013-09-03 Thread Angus Robertson - Magenta Systems Ltd
> Could it be some kind of proxy at the clients end ?
>
> I've just tried connecting without using passivemode on my PC and I 
> don't get a rejection as you can see from the logs below.

If the FTP server accepts your non-passive connection, that refused message
would not appear to be server generated, so yes it looks like the client's NAT
router or firewall is blocking workable FTP.  

My Sonicwalls do monitor FTP connections and drop them if they find something
they don't like, that once happened several gigs into a virtual disk download
when it found a password scanner tool it did not like and dropped the data
connection.

Such problems with FTP are most auto updaters use HTTP 

Angus

-- 
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] TSslFtpClient and OmniThreadLibrary speed

2013-09-17 Thread Angus Robertson - Magenta Systems Ltd
> The Create constructor makes a copy of the fFileList array and 
> creates the TFtpClient object.
> StartSync does the upload.

The only thing that should matter is that you set MultiThreaded=true and use
TIcsWndControl.MessagePump instead of Application.ProcessMessages.

My TMagFtp component has a threaded version using sync FTP commands, and has
been tested with 250 simultaneous FTP sessions. 

Angus

-- 
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] Best way to upgrade ...

2013-09-19 Thread Angus Robertson - Magenta Systems Ltd
> I am working on a project that was originally written in D5. And 
> the project using a free IRC component, SlyIrc by Steve Williams, 
> were it has used TWSocket v434 for its wsocket needs. 
 
> So, once I 
> edit this line to correctly use the FWSocket I now get the 
> following  hard error:
> 
> [dcc32.Error] SlyIrc.pas(741): E2003 Undeclared identifier: 
> 'LocalHostName'
> 
> The new error is with the same line of code as the previous error, 
> here is that specific line causing the error:
> 
> Send(Format('USER %s %s %s :%s', [FUsername, 
> FWSocket.LocalHostName, FHost, FRealName]));

Just remove FWSocket. and it will compile, at least after you also remove the
line with SlyIrcEx in the dpr since this is missing from the project.   

Can not tell you if it actually works since I've managed to avoid IRC for any
entire professional life.

Angus

-- 
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] Best way to upgrade ...

2013-09-19 Thread Angus Robertson - Magenta Systems Ltd
> Can not tell you if it actually works 

Should have said that since you want to use XE3, you also have to undertake a
Unicode conversion of the source code, since all the PChars and Strings will
now become wide by default.  You can trying changing them all to PAnsiChar and
AnsiString, but you'll then need Ansi versions of any functions called.

Angus

-- 
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 FTP Client - Error Handling

2013-09-20 Thread Angus Robertson - Magenta Systems Ltd
> Should the FTPErrror event play any part in the error handling or 
> can everything be sorted out from the FTPRequestDone event?

Generally, RequestDone is called for all events, but there are exceptions like
after ABORT.  So I always check for Connected after every command and die if
not. 

You can call CheckReady regularly which will raise OnError if not happy.
Essentially, don't trust any one event to be called in an error, it's a complex
component. 

Angus


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

2013-10-01 Thread Angus Robertson - Magenta Systems Ltd
> Yes, the applications are using the same version of the DLLs.

Are the DLLs in the same directory as the application?  If not, Windows will go
searching the environment path and may find old or corrupted SSL DLLs.  

I always like to log the SSL version and DLL file name when an application
starts, to avoid surprises. 

//Pre-loads OpenSSL DLL's
try
   SslContext.InitContext;
   Log.Lines.Add ('SSL Version: ' + OpenSslVersion +
  ', Dir: ' + GLIBEAY_DLL_FileName) ;
except
   on E: Exception do Log.Lines.Add ('Failed to Initialise SSL - ' 
+ E.Message);
end;

Angus




-- 
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-V8 has been released

2013-10-03 Thread Angus Robertson - Magenta Systems Ltd
> ICS-V8 has been released. 

The major changes in V8 include:

- Support for Delphi 7 to RAD Studio XE5
- Support for Firemonkey and Mac OS-X (still beta)
- New support for IPv6 in most components
- New SocketFamily property (sfAny, sfAnyIPv4, sfAnyIPv6, sfIPv4, 
 sfIPv6)
- New MultiListenSockets property for most servers to add extra 
 listening sockets, each with Addr/Port/SocketFamily/SslEnable 
- New IPv4 and IPv6 string addresses helpers
- New SMTP mail server component
- New threaded ping component and trace route demo
- Revised directory structure with more, smaller sample directories

Angus








-- 
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] Delphi TServerSocket vs ICS equivalent

2013-10-08 Thread Angus Robertson - Magenta Systems Ltd
> What I am wondering is would I be better off using one of the ICS 
> socket components for this. Maybe TWSocket or TWSocketServer. 

The latter.

> If so, what is the best demo to show how these components are used

OverbyteIcsTcpSrv.dpr is the main socket server demo, which works with
OverbyteIcsCliDemo.dpr.  

You can also look at several ICS high level servers that use Socket Server,
SMTP Server, FTP Server and HTTP Server. 

For speed, you can use my IP Log Streaming Component which will allow you to
make a working server (or client) in a couple of minutes without being too
concerned about all the component events.  

http://www.magsys.co.uk/delphi/magics.asp

Angus


-- 
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] Delphi TServerSocket vs ICS equivalent

2013-10-08 Thread Angus Robertson - Magenta Systems Ltd
> I assume I can set the component not to filter anything incoming. I 
> will be receiving shed loads of XML type data with CR LFs optional.

The two main decisions using TSocketServer are whether to send a banner on
answer (which upsets many clients) and whether to use LineMode to receive data.


LineMode=true is for short line oriented protocols and is easy to implement,
but you receive nothing until a LineEnd (defaults to CRLF) appears.  So
LineMode=false is safer and you receive random sized buffers which you process
as you wish.

Angus

-- 
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] Broadcast with several network adapters

2013-10-09 Thread Angus Robertson - Magenta Systems Ltd
> 3. I send UDP packets with a target address of 255.255.255.255
> This works fine as long as only one network adapter is present in 
> the system. But with more than one Windows picks the one with a 
> configured gateway and doesn't send anything via the local ones
> without defined gateway.

With TCP/IP, you normally set LocalAddr for the socket to determine which
interface is used, although this defaults to 0.0.0.0 so Windows chooses for you.
Not tried this with UDP broadcasting. 

Wsocket.LocalIPList gives you a list of local IPs, but some interfaces can be
ignored (VirtualBox creates it's own with private addresses) and some may have
multiple IPs.   So it's best to use the IP Helper IPs to list interfaces and
choose one IP address for each you want to use. 

Angus



-- 
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] Delphi TServerSocket vs ICS equivalent

2013-10-09 Thread Angus Robertson - Magenta Systems Ltd
> Alternatively you start a timer with short interval (100 ms) when 
> you receive data, reset the timer each time you receive data and 
> keep adding the data to a buffer.
> Once the timer triggers you can assume you have all data. This way 
> it keeps working of the XML layout changes :)

A timer is fine to handle lost connections where a partial record may have been
received without an expected record end, but is quite an overhead (particularly
with multiple clients) where there are better record ends: XML end tag, maximum
expected record length, CRLF, blank line, etc.  I variously use them all to
avoid buffering too much data. 

Angus

-- 
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] Can't get https://yahoo.com with latest version of TSslHttpCli

2013-10-09 Thread Angus Robertson - Magenta Systems Ltd
> Using the sample OverbyteHttpsTst application, I get the below, but 
> no body content. It looks like it goes through some redirects and
> switches to http from https.

Indeed, it switches to non-SSL but still using port 443, and you then get an
10053 abort error.  I've reproduced the same error using the browser demo.   

It's probably another error in the relocation code in the component, not
disabling SSL, or deliberately setting SSL due to port 443, or maybe the
opposite, not setting it due to http//:. 

Angus

-- 
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] Attach to a target thread?

2013-10-10 Thread Angus Robertson - Magenta Systems Ltd
> I'm starting with ICS. I need to build a http webservice with 6 
> worker threads that process jobs.
> I started my code based on the ThrdSvr sample project,

I'm sure you can achieve what you need with thread server, but I've never done
it, and you are also re-inventing the two existing web servers.  

I would start with OverbyteIcsHttpSrv or OverbyteIcsHttpAppServer depending on
your needs, and simply call your worker threads from within the client methods,
filling the answer stream which is returned to the main thread to be returned.


There is an example of using threads in the FTP server component, where they
are used while calculating MD5Sums.

Angus

-- 
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] Attach to a target thread?

2013-10-10 Thread Angus Robertson - Magenta Systems Ltd
> So my question: is there any way to attach a client connection to 
> another thread immediately, from the main thread?

Probably, but I've said I've not done it myself, no need.  Others may have done
so, but I don't believe it necessary for your application. 

> The problem is really that my worker threads are not available at 
> the time the client socket needs to be attached to one of those, 
> and waiting for a worker thread to be available would block the 
> main thread.

That is what Windows messages and events are for.  

Look at the sample OverbyteIcsWebAppServerMailer.pas which is probably pretty
much what you are doing, accepting data from the client, doing something and
giving a response.  The Execute method for the page triggers a DNS lookup with
the completed event creating the response page.  If the page has been POSTed,
it then starts to send an email using the SMTP component with more events, and
a timer runs to make sure a response gets sent within a few seconds.  

So you send a message to your job queue system, which runs your worker thread,
when it's finished it sends a message back and the response completes.  All
communications completes in the main thread. 

Angus

-- 
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] Connecting with Philips HUE

2013-10-13 Thread Angus Robertson - Magenta Systems Ltd
> I have a number of the Philips HUE lamps that I can control with 
> the iPhone app. 
> https://github.com/cDima/Hue/blob/master/Hue/UPnP.cs

This is a Universal Plug and Play discovery function, about which Francois has
written in his blog, with a demo program: 

http://francois-piette.blogspot.co.uk/2013/02/using-universal-plug-and-play-upnp
-with.html

So start with that demo to discover your lamps.  Then worry about sending them
HTTP requests. 

We should probably add the UPnP component to the ICS distribution, even though
it does actually use ICS, but a Microsoft COM object. 

Angus




-- 
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] Connecting with Philips HUE

2013-10-14 Thread Angus Robertson - Magenta Systems Ltd
> Thank you .  It compiled without errors using XE5 and returned this 
> result.
> PresentationURL  : http://192.168.0.105/index.html

Have you only got a single lamp?  Most installations would come back with
multiple lamps. 

Now you have the IP address of the lamp, and can use the HTTP client GET and
POST methods to change it's colours. 

Angus

-- 
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] Connecting with Philips HUE

2013-10-14 Thread Angus Robertson - Magenta Systems Ltd
> The HUE bulbs are linked via ZigBee and unfortunately Philips has not 
> published that specification.  That means any of my other custom
> lights cannot be connected through the HUE Ethernet/ZigBee bridge
> which is what the ICS application reported. 

OK, so you are talking to a bridge, which is in turn talking to the four lamps,
so ICS only sees once device.  Makes your life easier...

If you want to be very ambitious, you could try and write a component to talk
to the bridge supporting the various queries and commands as properties and
methods, so others can use it as well. 

Francois UPnP component would be windows only, for iOS and mobile platforms you
would need to rewrite it using TWSocket and UDP multicasting on port 1900 to
239.255.255.250, which was shown in the C# code you referenced. 

Angus

-- 
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-SSL / Proxy, Must I add something ?

2013-11-04 Thread Angus Robertson - Magenta Systems Ltd
> *Subject:* [twsocket] ICS-SSL / Proxy, Must I add something ?
> *From:* Bruno Mannina 
> I try to use HTTP-SSL behind a proxy server, so I give 
> host/port/user/pwd to the httpssl component.
> But it seems to not work.

Does a browser like Firefox work through the same proxy server with the same
settings and site you are using with ICS?  

One feature of SSL is that proxy servers can not intercept your traffic, I
believe you need a tunnelling proxy to work with SSL, but have never tried one
myself.

Angus

-- 
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] FTP Client - reconnecting

2013-11-06 Thread Angus Robertson - Magenta Systems Ltd
> For some reason the FTP server I'm connecting to seems to close the 
> session for no specific reason - here shown with a 426 error, that 
> currently my code is ignoring and hence I then get a later problem 
> 530.
> 
>  From my FTPClient logs
> 
> 15:36:17:405 local - C:\ProgramData\Navigator Systems\NX SQL 
> Server\Downloaded Updates\HireTrack NX\3.0.1.169\HireTrack NX.inf
> 15:36:17:405 host  - /pub/HireTRACK NX/autoupdates/HireTrack 
> NX/3.0.1.169/HireTrack NX.inf
> 15:36:17:405 changing to binary mode
> 15:36:17:405 Request MlsdAsync Done.
> 15:36:17:405 StatusCode = 0
> 15:36:17:405 LastResponse was : ''
> 15:36:17:405 Error = 426 ()
> 15:36:17:701 Session Connected, error = 0
> 15:36:17:701 Request MlsdAsync Done.
> 15:36:17:701 StatusCode = 220
> 15:36:17:701 LastResponse was : '220 ProFTPD 1.3.3a Server (My FTP 
> server) [:::205.196.214.163]'
> 15:36:17:701 No error
> 15:36:17:701 C:\ProgramData\Navigator Systems\NX SQL 
> Server\Downloaded Updates\HireTrack NX\3.0.1.169\HireTrack NX.inf
> 15:36:17:701 starting download
> 15:36:17:859 Request GetAsync Done.
> 15:36:17:859 StatusCode = 530
> 15:36:17:859 LastResponse was : '530 Please login with USER and 
> PASS'

You are sending commands out of sequence, the session connected event appears
after you've already sent two commands, you then start to download before
you've even logged into the server.  You also ignore the 426 error and the
other out of sequence responses. 

Looks like you are using async methods and not waiting for them to complete
before sending more commands. 

> My question is whether FTPClient component has this reconnection 
> and retry option already built in (and I just need to activate it 
> by setting a property) or whether I need to code it up myself ?

Retrying won't help if you are not waiting for command to complete.  
The basic FTP component does not automate anything except the login sequence,
and does not handle any errors with retries.  

Instead you should use TMagFtp from: 

http://www.magsys.co.uk/delphi/magxfer.asp

which automates everything and does file and session retries, if requested.

Angus
 


-- 
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] FTP Client - reconnecting

2013-11-06 Thread Angus Robertson - Magenta Systems Ltd
> I don't think so (though I will double check), as this is happening 
> about 30 seconds in to the process, I've already iterated through 
> all the directories and put together a list of files I need to 
> download and downloaded quite a few of them.

Never the less, your log shows a connected event, followed by the prompts for a
new connection to a FTP server, so maybe you disconnected earlier and
reconnected somehow? 

> I tested earlier with your DUNmanager as I read that it uses the 
> TMagFtp and that had a similar problem (though it could be because 
> I hadn't set something correctly)
> I tried the View Remote Files option, with all logging turned on. 
> After a couple of hundred files it gave up too.
> 
>  > PASV
> < 227 Entering Passive Mode (205,196,214,163,179,155).
>  > MLSD /pub/HireTRACK NX/autoupdates/navigator_nxserver/3.0.1.67/
> FTP Session Closed
> Directory Listing Abandoned, Not Connected
> Directory Listing Abandoned, Failed Response
>  > QUIT
> Task Result: Failed
> Request Failed: No Directory Listing

It's possible you have reached a large directory that is taking a long time to
process, and the session is timing out.  

I got caught myself the other day with a large download that took longer than
60 seconds to compress using Z Mode, and the session closed before the server
responds.  Try increasing the Abort Timeout to 3 or 4 minutes and retries to 2
or 3 above it. 

Angus

-- 
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] FTP Client - reconnecting

2013-11-07 Thread Angus Robertson - Magenta Systems Ltd
> Angus, trying to change the code to use your components. Does the
> TMagFtp component support  a CopyType := FCTypeDates ;

Sorry, seems like I never supported specific date ranges for FTP which is
mostly used to synchronise remote and local directories, or for specific files.

 
> if so, how does one set the dates as fMagFileCopy is declared as 
> private so these aren't accessible ?

You'd have to create new published properties for the component and makes sure
they are passed when comparing the directories. 

Beware none of my demo or current live applications use date ranges, that
feature may have got implemented for a private project 10 years ago but has
certainly not been tested in recent years. 

Angus

-- 
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] FTP Client - reconnecting

2013-11-07 Thread Angus Robertson - Magenta Systems Ltd
> *Subject:* Re: [twsocket] FTP Client - reconnecting
> Now trying with your components and although it's much better 
> behaved and fails gracefully, it still fails (in my app or the 
> supplied demo app).
> However as both your app and my app fail with my hosted FTP server 
> and both work with your FTP server, I'm going to assume that 
> there's something amiss with the ISP's FTP offering. Any clues in 
> the log as to what it could be  ?
> 
> FTP Session Closed
> Downloaded File c:\ftp_test\hiretrack nx\3.0.1.151\hiretrack 
> nx_cab.tmp, Size 321,058
> Request Failed: Partial File Downloaded, Resume Allowed, Expected 
> File Size 12,325,384, Actual Size 321,058

Looks like the session closed after two seconds of downloading, once 300K of
data had been done.  

No reason for the server or client to close during a data transfer, it could be
a firewall somewhere closing the TCP connection.  

My own firewall does this if it finds something nasty part way through the file,
it's been deleting mails supposedly from the taxman at gateway.gov.uk today
which are actually viruses, the emails are very authentic since I had a real
one yesterday when I submitted taxes online, and then got a reply to the email
address less than 12 hours later that was almost the same except for a zip
attachment.  

Or maybe the FTP server has a badly implemented session timeout?  Can you get
the server logs or is not your server? 

Angus

-- 
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] SslSmtp - What do I need for an eMail Client?

2013-11-13 Thread Angus Robertson - Magenta Systems Ltd
> I want to switch my eMail Program from smtp to ssl smtp. I've tried 
> the demos - everything looks fine, but what did I have to deliver 
> with my application (in special I mean the certificates!). Did I 
> have to generate and deliver the certificates? I want to use TLS 
> and SSL.

Assuming you are talking about an SMTP client application, SSL certificates are
totally optional. 

For SSL client applications, SSL certificates are only needed if the SSL server
to which you connect is set-up to validate the certificate of clients, which is
rare. 

For SSL server applications, certificates are mandatory, although a self signed
certificate (as used with the ICS demos) is adequate if the client only wants
an encrypted connection and does not need to check the authority of the server.


Angus



-- 
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] SslSmtp - What do I need for an eMail Client?

2013-11-13 Thread Angus Robertson - Magenta Systems Ltd
> I was just wondering that the certificates are set in the demo. 
> Thank you and best regards!

The SSL client component still needs an SslContext component, but you can
ignore all it's properties. 

Angus

-- 
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] Errors while send, if client disconnected from socket

2013-12-24 Thread Angus Robertson - Magenta Systems Ltd
> Sometimes client can disconnect on multithreaded server while send, 
> after that I receive "Range check error" or "Socket is not 
> connected (#10057 in Send)"

SVN for V8 is updated with Francois' cast fix in various PostMessages to avoid
the range check error (some were already cast correctly). The zip will be
updated tonight. 

Angus


-- 
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] [Off Topic] Vote for Delphi on Code2013

2014-01-03 Thread Angus Robertson - Magenta Systems Ltd
> Well, I said how to vote: "You can cast your vote by sending a 
> tweet 

So it's effectively a survey of Twitter followers about their favourite
language, excluding the many people who don't use 
Twitter  

If they wanted a properly representative survey, there would be several voting
methods. 

Angus

-- 
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] [Off Topic] Vote for Delphi on Code2013

2014-01-03 Thread Angus Robertson - Magenta Systems Ltd
> Is the relative number of language users different among those 
> having a
> tweeter account and the others? I don't think so. So the result IS
> representative.

Older people often don't have the time or inclination to keep up with the
trends our children follow. 

I've been using the same social networking service since 1986, started before
the internet really existed, and don't see the need to join the dozens of
social networking sites that come and go over the years. 

Also, I suspect younger developers are more interested in PHP and Javascript,
than in Delphi and C. 

Angus

-- 
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] RFC 822 Date Time Conversion

2014-01-30 Thread Angus Robertson - Magenta Systems Ltd
> Has anyone got a solid method of converting RFC 822 date times 
> (e.g. Thu, 30 Jan 2014 05:48:07 +0800) to a TDateTime. 

There are RFC1123 date parsing functions in OverbyteIcsSmtpSrv.pas and
OverbyteIcsHttpProt.pas, but neither handle the time zone. 

Angus

-- 
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] OverbyteIcsFtpCli v8 (current) old problem resurfaces

2014-02-07 Thread Angus Robertson - Magenta Systems Ltd
> { V8.03 InternalReady happens between multiple commands, ignore it }
> if FState in [ftpReady {, ftpInternalReady}] then begin
> Include ftpInternalReady in the check and it should work again.
> 
> @Angus, why did you change it?  

For the reason documented in the code, the longer version is at the top of the
module:

> Fixed bug in WaitUntilReady that meant some sync methods with multiple
> commands randomly terminated prematurely allowing further commands to
> be sent usually resulting in not ready errors.

TriggerRequestDone is called after each command which sets ftpInternalReady
(except for passive PUT), but this means it's set briefly during numerous async
methods, often after PORT before LIST, GET or PUT has started.  So
WaitUntilReady exits before other commands are done.  I'd been seeing these
errors for many years.

Angus



 




-- 
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] default gzip of json by THTTPServer - is it possible or am I to do it myself?

2014-02-07 Thread Angus Robertson - Magenta Systems Ltd
> I have enabled content encoding on my THTTPServer:
> And return content to my client using AnswerString
> 
>  pClientCnx->AnswerString(Flags,
>   "200 OK",
>   "application/json",
>   sResponseHeader,
>   sResponseBody);
> 
> However if my client includes "Accept-Encoding: gzip" in its 
> request header the OnHttpContentEncode event is not called.

>  if (ContType = '') or (Pos ('text/', ContType) > 0) or (Pos 
> ('xml', ContType) > 0) then begin{ only compress textual stuff }

Not used JSON myself, but I'd guess if it's a compressable response then
'application/json' needs to added to that line so compression is not skipped.

Angus


-- 
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] default gzip of json by THTTPServer - is it possible or am I to do it myself?

2014-02-12 Thread Angus Robertson - Magenta Systems Ltd
> Not used JSON myself, but I'd guess if it's a compressable response 
> then 'application/json' needs to added to that line so compression is 
> not skipped.

SVN was updated a couple of days ago with this JSON fix in the HTTP Server,
also now compressing Javascript, and recognising both as MIME types.

Angus

-- 
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] Handshake of TWSocket

2014-02-18 Thread Angus Robertson - Magenta Systems Ltd
> > is there anybody who can and will explain to me if the socket 
> > handshake protocol is implemented 

>   GET /chat HTTP/1.1
>   Host: server.example.com
>   Upgrade: websocket

Sorry, websockets is not supported by the ICS HTTP components.  

Another ICS user  has implemented websockets:

http://code.google.com/p/ics-websockets/

although I've never looked at it, and the project does not seem to have been
updated for over a year. 

Angus

-- 
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] Basic HTTP Authentication over SSL

2014-02-18 Thread Angus Robertson - Magenta Systems Ltd
The process should be as follows:
1)  Use HTTP POST to pass username and password parameters to login URL
2)  A token string is returned if login was successful
3)  The token is then used as Basic Authentication using HTTP GET to
retrieve JSON from different API URL

Step 1 and 2 are normal and simple, step 3 is unusual, basic authentication is
rarely used to pass tokens, they are normally sent as parameters with the
request or handled as cookies.  

You really need a proper log in your code so you can see exactly what commands
are sent, and the responses received.  Look at the Browser demo, which supports
authentication and cookies.  

Angus

-- 
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] No Socket Handshake available

2014-02-18 Thread Angus Robertson - Magenta Systems Ltd
> I encountered that the socket handshake, as described in RFC 6455, 
> is not implemented in the ICS components of overbyte.

That standard is websockets, not sockets, totally different. 

Websockets is not supported by ICS, see the answer I gave you yesterday which
you ignored, I suggest an ICS component that does websockets. 

Angus

-- 
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] Multiple TCp clients

2014-02-25 Thread Angus Robertson - Magenta Systems Ltd
> I am trying to interface with some laboratory instruments, 
> previously we used RS-232, now we are working on the next 
> generation of machines. The instruments act as servers, 

You might want to look at our ComCap software, which is widely used for
capturing data from lab and medical instruments. 

http://www.magsys.co.uk/comcap/

It uses arrays of dynamically created TWSocket components acting as client or
server, to capture up to 999 streams simultaneously.  It includes ComGen which
is a free serial and IP data stream generator, which creates hundreds of
simultaneous client or server streams, it may help your testing. 

Both these tools are created using the free IP Log Streaming Component, 

http://www.magsys.co.uk/delphi/magics.asp

again using arrays for multiple dynamic instances.  The component handles all
TCP errors and retries for lost connections automatically and should allow you
to get an application running in a couple of hours. 

> Now, I would like to set it up such that I can talk to each
> instrument in turn 

There is an overhead in opening and closing TCP connections, very little
overhead in keeping them open.  So I'd recommend you treat each instrument
separately and keep a connection open to it, rather than round robin
connections to one at a time, unless you are talking about more than a thousand
instruments. 

Angus

-- 
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] When receiving UDP datas, find if there were sent through a broadcast

2014-02-25 Thread Angus Robertson - Magenta Systems Ltd
> I have a server with an UDP socket listening.
> Some Clients connect with the Ip address of the server : Direct 
> Addressing.
> Some Clients do not know the Ip address of the server, therefore 
> they connect by sending a broadcast.
> In OnDataAvailable event, i would like to know which Clients have 
> been connected through a broadcast.

I don't believe there is anything in the IP protocol that will identify a
broadcast.  So you can either arrange the clients tell you as part of the data
you send, use a different port for broadcasts, or keep track of the IP
addresses locally (if you know already). 

In DataAvailable, you can use ReceiveFrom the get the IP address of the remote
client. 

Angus

-- 
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] When receiving UDP datas, find if there were sent through a broadcast

2014-02-26 Thread Angus Robertson - Magenta Systems Ltd
> If not, is there a flag somewhere in twsocket  to tell an UDP 
> socket to ignore clients who knocks on a given port with a 
> 255.255.255.255 address ?

The only addresses provided by the protocol are source and destination, I don't
know broadcasting is implemented, but would assume it's down to ARP tables of
MAC addresses on the LAN.  

Angus

-- 
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: Microsoft network sniffers

2014-03-11 Thread Angus Robertson - Magenta Systems Ltd
Never noticed them before, but Microsoft has two network traffic monitoring or
sniffer tools.

The older one is Microsoft Network Monitor 3.4 for XP and later, and Microsoft
Message Analyzer 1.0 for Windows 7 and later, both free from the download
center.  

Has anyone tried either? 

I note that Nirsoft 'Who is connected sniffer' supports WinPcap and both the
Microsoft tools, so presumably there is a published interface for them to allow
application control.

Has anyone tried the Microsoft sniffers?

Angus

-- 
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] Using ICS V5 POP3 with SSL

2014-03-12 Thread Angus Robertson - Magenta Systems Ltd
> *Subject:* [twsocket] Using ICS V5 POP3 with SSL
> *From:* Veit Zimmermann 
> *To:* twsocket@lists.elists.org
> I have to replace an old ICS V5 with a SSL enabled version. I 
> thought the easiest way would be to replace it with the V5 SSL 
> version, but It doesn't work for some reason.

V5 has not been tested for five years. Why not use V8? 
> 
> If I use the SslMailRcv demo I can connect fine to gmail and one 
> other POP server when using Explicit SSL, but it fails when I 
> command STLS with Command Unknown When using Implicit SSL 

Some POP3 servers may not support SSL on port 110, only on port 995. 
pop.gmail.com does not listen on port 110. 
 
> Could it be I really need a Certificate to connect via Implicit 
> SSL? That would be new to me.

No, you don't need a certificate for an SSL client application, unless the
server rejects you specifically for that reason, and certainly not for gmail.


Angus

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

2014-03-19 Thread Angus Robertson - Magenta Systems Ltd
> I am starting to get users who want to step up the security of the 
> FTP connection and are tending towards SFTP (S being Secure and not 
> Simple in this case) rather than FTPS. Simplicity of getting though
> firewalls seems to be a consideration. 

Don't believe SSL makes firewall support any easier, might make it harder since
NAT translation can not scan the control channel for internal IP addresses. 

> I see that ICS now has a suite of SSL components

ICS has supported SSL with FTP for several years. 

> but is this something that is on the ICS radar for future development.

What FTP SSL features are missing or need more development?

Angus

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

2014-03-19 Thread Angus Robertson - Magenta Systems Ltd
> I get the impression there are two types of secure FTP:

SFTP or FTPS are non-standard confusing names, and different people interpret
them in different ways.  That's why we specify FTP SSL, and not FTPS to clearly
identify what is offered by ICS. 

There is also FTP over SSH, which is really a UNIX thing where SSH is used for
to provide a secure shell for numerous protocols. So it's not really an FTP
protocol as such, there are no SSH related FTP commands.  But it's simple for
UNIX systems since their ancient FTP clients and servers can be used securely
without modification.  

The major disadvantage of SSH is no public certificates, so any encryption keys
need to be privately arranged.  

There are no plans to support SSH with ICS, but you can configure it yourself
using a Windows SSH program, forget the name off hand.  

Angus

-- 
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] FTP TLS, SSL, + passive mode problem

2014-04-16 Thread Angus Robertson - Magenta Systems Ltd
> i'm using FTPcli in one of my projects, and i have problem with 
> FTPs over TLS with passive mode..
> I have disconnects during the uploads: sometimes upload goes 
> through but in most cases upload stops after PASV command...
> This happens with different types of files and at least on 2 FTP 
> servers (ProFTPD  and FileZilla Server).

Are you testing against local FTP servers on a LAN, or public servers across
NAT routers and firewalls?  

95% of FTP problems that happen when the data connection opens are caused by
NAT routers or firewalls blocking the new connection.  This is worse with SSL
since the router can not modify the control channel to change the internal IP
address to an external address. 

It's unlikely to make any difference, but you can test against the ICS SSL FTP
server on ics.ftptest.org.

BTW, ICS v7 is very old and no longer maintained, you should be using v8. 

Angus


-- 
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 when using TPing with TSslWSockServer

2014-04-17 Thread Angus Robertson - Magenta Systems Ltd
> in unit of OverbyteIcsIcmp,
> the TICMP.Destroy have some problem

Thanks, now fixed in V8 and SVN will be updated overnight. 

Angus

-- 
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] HTTP PATCH method for the HttpCli

2014-04-18 Thread Angus Robertson - Magenta Systems Ltd
> Any technical reason for discarding this functionality I submitted
> some time ago?

How do we test it?  There is no sample to run.  Nothing to test against.  I
don't have time to read the Google Drive API,

Angus



-- 
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] Clarification Re: "FTP TLS, SSL, + passive mode problem"

2014-04-18 Thread Angus Robertson - Magenta Systems Ltd
> asked me about it), this server is private (hosting in US : 
> atomicvps.com)

So you are using a public server on a WAN, with a NAT routers or a firewall on
either end of the connection?
 
> as another test i also installed local filezilla server and was 
> able to reproduce same problem with it (ICS upload to local 
> filezilla server)

But now you say it fails on the LAN as well, is that with the ICS SSL demo FTP
application? 

This is an extract log from the ICS FTP server I asked you to test against,
which shows Passive mode with SSL does work OK.  This test is done using my DUN
Manager application you can download and test from: 

http://www.magsys.co.uk/dunman/

Starting FTP Download from: ics.ftptest.org
Connect/Logon to FTP Server: ics.ftptest.org:990
Check for Old SSL Session
! SSL handshake OK
SSL Handshake Done OK, Secured with TLSv1, Cipher AES256-SHA, Secret Bits 256
(Total 256)
0 Certificate(s) in the verify chain
Starting SSL Session
Cache SSL Session: New
< 220-ics.ftptest.org
< 
< 220-ICS TFtpServerW (c) 1998-2013 F. Piette V8.04
< 220 Server: MAGPUB2 at 2014-04-08T19:17:26
FTP Session Connected to 217.146.102.142:990

Downloading File: /test/testcode.asp to E:\temp1\testcode.asp, size 10.7 Kbytes
> PASV
< 227 Entering Passive Mode (217,146,102,142,82,82).
> RETR testcode.asp
Check for Old SSL Session
< 150 Opening data connection for testcode.asp.
! SSL handshake OK
SSL Handshake Done OK, Secured with TLSv1, Cipher AES256-SHA, Secret Bits 256
(Total 256)
0 Certificate(s) in the verify chain
Starting SSL Session
Cache SSL Session: Reuse
< 226 File sent ok
! 10.7Kbytes received/sent in 250 milliseconds
Downloaded File e:\temp1\testcode_asp.tmp, size 10.7 Kbytes
Updating Time Stamp: E:\temp1\testcode.asp to (UTC)=20080307-23
Download OK: E:\temp1\testcode.asp, size: 10.7 Kbytes, duration 0:00, average
speed 38.1K/sec

Angus

-- 
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] HTTP PATCH method for the HttpCli

2014-04-18 Thread Angus Robertson - Magenta Systems Ltd
> It's exactly the same code as for POST and PUT. Only the HTTP 
> method name changes. 

So there is no way for us to test the changes, without extra development to
change our web samples? 

I also can not make TortoiseSVN recognise your patch file, which is either
faulty or badly formatted, or maybe I just don't know how to use SVN.

Angus

-- 
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] HTTP PATCH method for the HttpCli

2014-04-20 Thread Angus Robertson - Magenta Systems Ltd
SVN is now updated with the PATCH method in the HTTP Client.

Angus

 Original Message 

*Subject:* Re: [twsocket] HTTP PATCH method for the HttpCli
*From:* RTT 
*To:* ICS support mailing 
*Date:* Fri, 18 Apr 2014 17:31:38 +0100

On 18-04-2014 16:34, Angus Robertson - Magenta Systems Ltd wrote:
> So there is no way for us to test the changes, without extra development to
> change our web samples?
>
> I also can not make TortoiseSVN recognise your patch file, which is either
> faulty or badly formatted, or maybe I just don't know how to use SVN.
I've sent you the file OverbyteIcsHTTProt.pas, with the changes already 
applied, and the OverbyteIcsHttpTst1 project, changed files, with the 
Patch method implemented.

You can test it against this online service
http://httpbin.org/
Just set the URL to the patch endpoint, http://httpbin.org/patch, add 
some text to the data field, and click the "Patch" button.

-- 
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] SSL improvements

2014-04-20 Thread Angus Robertson - Magenta Systems Ltd
To improve handling and reporting of PEM SSL certificates, there is a new
component class TX509Ex derived from TX509Base adding properties for most
common certificate entries including extensions, there are the properties
reported for my code signing certificate, as reported by the updated
OverbyteIcsPemTool tool: 

---
ISSUED TO (Subject)
Common Name (CN):Magenta Systems Ltd
Alt Name (DNS):
Alt Name (IP):
Organisation (O): Magenta Systems Ltd
Organisational Unit (OU): SECURE APPLICATION DEVELOPMENT
Country (C): GB
State/Province(ST): England
Locality (L): Croydon
Serial Number: 
Title (T): 
Initials (I): 
Given Name (G): 
Surname (S): 
Description (D): 
Email (Email): 

ISSUED BY
Common Name (CN):Thawte Code Signing CA - G2
Organisation (O): Thawte, Inc.
Organisational Unit (OU): 
Country (C): GB
State/Province(ST): England
Locality (L): Croydon
Email (Email): 

GENERAL
Serial Number: -1
Issued on:12/10/2013
Expires on:16/10/2014
Key Usage: 
Extended Key Usage: Code Signing, Microsoft Commercial Code Signing
Basic Constraints: CA=FALSE
Authority Info Access: OCSP - URI=http://ocsp.thawte.com
---

A certificate authority certificate is reported similarly to the following,
which is reported as self signed, by a CA:

---
ISSUED TO (Subject)
Common Name (CN):thawte Primary Root CA
Alt Name (DNS):
Alt Name (IP):
Organisation (O): thawte, Inc.
Organisational Unit (OU): Certification Services Division, (c) 2006 thawte, Inc.
- For authorized use only
Country (C): US
State/Province(ST): 
Locality (L): 
Serial Number: 
Title (T): 
Initials (I): 
Given Name (G): 
Surname (S): 
Description (D): 
Email (Email): 

SELF SIGNED

GENERAL
Serial Number: -1
Issued on:17/11/2006
Expires on:16/07/2036
Key Usage: Certificate Sign, CRL Sign
Extended Key Usage: 
Basic Constraints: CA=TRUE
Authority Info Access: 
---

The OverbyteIcsPemTool listview now reports the common name, issued to and
issuer, for each certificate it finds in the specific directory. 

When using OverbyteIcsPemTool to create self signed certificates, certificate
requests, and creating PEMs from the Windows Certificate Store, optionally
clear text comments can be added before the base64 blocks to easily identify
different certificates (which otherwise all look much alike), ie:

---
# X509 SSL Certificate
# Subject Common Name: RapidSSL CA
# Subject Alt Names: 
# Subject Organisation: GeoTrust, Inc.
# Issuer: GeoTrust Global CA
# Expires: 18/02/2020
-BEGIN CERTIFICATE-
---

When creating a certificate requests and self signed certificates, the private
key and certificate may now be optionally saved to separate files, since you
certainly don't want to distribute your private key anywhere. 

Note these changes are in OverbyteIcsSslX509Utils.pas which is currently in the
Samples/Delphi/SslInternet directory, it may be more convenient to copy it to
the main source directory. 

Angus


-- 
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] Invitation to test ICS and OpenSSL 1.0.1g

2014-04-21 Thread Angus Robertson - Magenta Systems Ltd
> I uploaded the OpenSSL libraries 1.0.1g to the wiki site.
> And updated the SVN to allow that version of OSSL.
> I did not had much time to test, so I have to invite users
> instead to test their ICS applications against the new OSSL 
> and report any problem that was not yet with an older OSSL 
> version.

Thanks Arno, I've updated my public web and FTP servers with OpenSSL 1.0.1g,
and all my main client applications, no changes needed anywhere, everything
still just works. 

It's worth noting that few ICS applications would have been at risk from the
Heartbleed bug, since the last OpenSSL release distributed and supported by ICS
was 1.0.0j, and the bug started with 1.0.1.  

ICS prevents later OpenSSL versions running, so it would have needed users to
manually patch OverbyteIcsLIBEAY.pas to allow later versions to load. 

Angus

-- 
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] Openssl-1.0.1g

2014-04-21 Thread Angus Robertson - Magenta Systems Ltd
> Will you be testing 1.0.1G soon? 

Already done and announced in this mailing list over the weekend.

Angus

-- 
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] TFtipClient and TFtpServer and 10053 error after Transmit successful...

2014-04-22 Thread Angus Robertson - Magenta Systems Ltd
> The Transmit method returns failure even though the file is 
> successfully uploaded. Notice how the request is 18, the StatusCode
> is 226 but an Error 500 is returned with a winsock error of #10053).  

226 is success, so no idea why you get 500 as well.  

The transmit method does several commands in sequence, but you are not logging
enough to see where the error is happening.  You really need to log the
onDisplay, OnError and OnResponse events so you see all the command responses
being processed. 

#10053 is connection aborted, which generally does not matter if the important
commands have already been successful. 

Angus


-- 
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] TFtipClient and TFtpServer and 10053 error after Transmit successful...

2014-04-25 Thread Angus Robertson - Magenta Systems Ltd
> Not sure if this gives us more information to go on.  Any ideas?

Assuming you are logging OnError, I can see no errors reported, so all we have
is the error code 500 after a sequence of FTP events that all appear to have
completed correctly. Are you logging the ErrorMessage property at the end, it
may have something? 

However, there seems to be a missing response to QUIT, it should be:

> QUIT
< 221 Goodbye.
FTP Session Closed

so maybe this is where your abort error is coming from.  If you log a different
client without the error, do you see 221? 

I've never used TRANSMIT, or any of the other methods that do a complete FTP
session using a single method, the problem is you really have no idea when it
fails as to why, as you've discovered.  I use the separate methods and check
for errors after every command.  But I ignore errors for QUIT and ABORT, since
nothing actually matters at that point.

Angus







-- 
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] C++Builder XE6

2014-05-13 Thread Angus Robertson - Magenta Systems Ltd
> 1. Any chance for a C++Builder XE6 project?

Sorry, there are no new C++ Builder for XE4/5/6 and old packages are not being
tested with new components.  

Maintaining support for two new versions of Delphi a year and all the old ones
is painful and tedious, just for Delphi there are 16 different packages to
update and test the 11 versions of Delphi we try to support, and three
different platforms  Win32/64/OSX), and there are eight more C++ Builder
packages with three missing. 

All this package maintenance has to be done manually, and it's very time
consuming.  There are only three main contributors to ICS, and only one who
understands C++ Builder, and he no longer has the spare time to keep updating
C++ Builder packages.  

So we need a new contributor to help us maintain the C++ Builder packages, any
offers?  Someone must be using recent versions of C++ Builder.  

> 2. The cookie manager component seems to always get left out...

That was my component, and I don't understand C++ so can not test it or create
a C++ sample application. 

> how can I add this component to the C++Builder XE3 project 

There is nothing special about editing and creating packages, just open the XE3
package in C++ Builder, add the missing components, update XE3 references to
XE6, save, build and install.  There is a risk compiler changes may stop you
building the packages, needing source changes.  

Angus

-- 
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] C++Builder XE6

2014-05-13 Thread Angus Robertson - Magenta Systems Ltd
> I think my best option may be to just get Delphi and install them 
> in Delphi where they will also be available in C++Builder.

Sorry, no idea if this would work, I thought the two environments were separate,
except C++ Builder also includes a Delphi compiler for the libraries.  

> I couldn't get the cookie manager component to build & install. 

No idea why, it's simple Delphi code, it has the same BCB conditional stuff as
other ICS units. 

Angus

-- 
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] C++Builder XE6

2014-05-13 Thread Angus Robertson - Magenta Systems Ltd
> I would be happy to share my work if you'd like and you think it 
> might be helpful to others... 

Probably, but we really need all three missing BCB versions tested, which needs
someone with all these versions installed, which is not trivial. I have Windows
7 VM that is currently 120 gigs with 13 (I think) versions of Delphi/BCB
installed, which I use for testing ICS, it was a pain to set-up, I hope it
never self destructs so I don't have to start again. 

> Also, I have a question about the 'Debug' vs 'Release' build. Right 
> now it seems the projects compile with the 'Debug' build. What
> advantage does compiling for 'Release' have? 

What actually happens for debug and release builds can be customised, but
generally release is smaller since there is no debug information in the EXE.  

Angus

-- 
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] C++Builder XE6

2014-05-13 Thread Angus Robertson - Magenta Systems Ltd
> Copy/backup your VMs so you can keep the setups.

I do have backup, the problem is Windows can self destruct due to too many
patches and changes, had to re-install XP every couple of years.  Hopefully
Windows 7 is more stable, particularly as the VM is only used for component
building and testing.  

Angus

-- 
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] TSslPop3Cli... 6.13

2014-05-26 Thread Angus Robertson - Magenta Systems Ltd
> I am having trouble deleting messages in Gmail via POP3. 

No problem here with some code I wrote 16 years ago:

Opening Mailbox: Google Mail
! Starting SSL handshake
Mailbox Opened Securely with TLSv1.2, cipher ECDHE-RSA-AES128-GCM-SHA256
< +OK Gpop ready for requests from 82.41.127.188 q51mb89935546wej
POP3 Session Connected to 173.194.66.109:995
> USER recent:x...@googlemail.com
+OK send PASS
< +OK send PASS
> PASS #
+OK Welcome.
< +OK Welcome.
> CAPA
+OK Capability list follows
< +OK Capability list follows
USER
RESP-CODES
PIPELINING
LOGIN-DELAY 300
TOP
UIDL
X-GOOGLE-RICO
.
> STAT
+OK 35 95763
< +OK 35 95763
> LIST
+OK 35 messages (95763 bytes)
< +OK 35 messages (95763 bytes)
1 804
35 958
.
> UIDL
+OK
< +OK
1 GmailId145bd1cf4a43eaac
35 GmailId14616f45108f0449
.
> DELE 1
+OK marked for deletion
< +OK marked for deletion
> DELE 2
+OK marked for deletion
< +OK marked for deletion
> DELE 3
+OK marked for deletion
< +OK marked for deletion
> DELE 4
+OK marked for deletion
< +OK marked for deletion
> QUIT
+OK Farewell.
< +OK Farewell.

Note messages are only deleted when the mailbox is actually closed with the
QUIT command. 

Angus

-- 
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] TSslPop3Cli... 6.13

2014-05-26 Thread Angus Robertson - Magenta Systems Ltd
> > Note messages are only deleted when the mailbox is actually 
> > closed with the QUIT command.
> 
> I think that is the issue. This is a 24/7 program and I do not 
> issue the quit until the program is stopped.

POP3 mailboxes are rarely dynamic, they show a snapshot of the content when
opened, and not email that arrives while they are open.  Otherwise the STAT,
LIST and UIDL command message numbers would not match the message numbers when
you retrieve or delete something.  

I guess they could retrieve new content each time one of those commands is
issued, and maybe that is what a modern database driven POP3 mailbox can do,
unlike the old flat file mailboxes from years ago.  

But generally closing the POP3 mailbox as soon as possible is the way to work. 

Angus



-- 
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 and 307 or 308 redirects with non GET methods

2014-05-27 Thread Angus Robertson - Magenta Systems Ltd
> This subject doesn't deserve not even a reply?!

I'm the only one able to fix things here at the moment, and I have a lot of
other priorities.  But I'll put it on my list for next month.

Angus

-- 
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] SmtpCli/TWSocket bug: wrong Socks behaviour

2014-05-30 Thread Angus Robertson - Magenta Systems Ltd
> Found a bug in Socks implementation. 
> Current ICS implementation (v7 and v8) not allow to use socks 
> server if they configured to listen on IPv4 IP but send out from
> IPv6 IP !

Don't believe IPv6 is supported for SOCKS, yet. 
 
Can you not set the local interface to IPv4 to avoid the problem?

Angus

-- 
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] Best multithread approach to build http server

2014-05-30 Thread Angus Robertson - Magenta Systems Ltd
> I'm building a service application based on THttpServer. For each
> OnGetDocument event I'm building and returning XML. The XML building
> process can be lengthy and I'd like to be able to handle other 
> requests while one is being processed.

Look at the the FTP server component.

This is fully event driven, but creates a thread for certain lengthy blocking
operations, like directory listing and calculating CRC32/MD5 of large file.
When the thread completes, the response is sent.  These threads will handle
multiple requests.  

As currently designed, the component creates a new thread for each command, but
they are rare commands.  You may be better off with a pool of threads, maybe
each with it's own open SQL connection which is also an overhead to open. 

Angus

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

2014-06-04 Thread Angus Robertson - Magenta Systems Ltd
> Do the OnSessionConnected, OnSessionClosed and OnDataAvailable 
> events run in their own threads?  

No, TWSocket does not use any threads.  Windows does internally, but that is
transparent to a Delphi application. 

All events are called in the context of the thread in which the component is
created, usually the main application.  Generally, it's not a good idea to do
anything complex in the events, but trigger your own event (with PostMessage)
for further processing. 

If you are doing a lot of different connections, it's important to wait for
session connect and disconnect events to be called, before starting a new
connection, since TCP/IP has long timeouts for lost or failed connections.
Call Abort to break a connection, but still wait for the event. 

ICS does allow you to make simultaneous connections to multiple different
remote devices, without needing threads, several hundred if necessary, memory
permitting. 

Angus

-- 
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] TnEmulVT updated

2014-06-05 Thread Angus Robertson - Magenta Systems Ltd
Thanks for DrJohn for changes to OverbyteIcsTnEmulVT and OverbyteIcsEmulVT, as
follows:

May 28, 2014  v8.02 DrJohn fixed problem with (border) colours
AutoResize property added with improved font resizing
SoundOn property added
GetScreenText function added
Fixed bug during connect if control not visible

Angus

-- 
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 and 307 or 308 redirects with non GET methods

2014-06-05 Thread Angus Robertson - Magenta Systems Ltd
> The 307 and 308 redirects must maintain the same request method, 
> and not revert to GET as with other redirects.

This change is now in SVN, although there is a lot of online debate over many
years about whether this change is allowed by the RFCs, at least without user
interaction, different browsers implement redirection in different way. 

Angus

-- 
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 and 307 or 308 redirects with non GET methods

2014-06-06 Thread Angus Robertson - Magenta Systems Ltd
> My understanding is that, when redirecting, the request method 
> should revert to GET, for any method (POST, PUT, DELETE,...) and 
> only maintain it when the redirect is of type 307 or 308.

>From which RFC (and section)?

> The way you have code it only works for POST.

Yes, should HEAD revert to GET? 

I'm not saying you are wrong, but there are a lot of different opinions about
this, and frankly I didn't have time to read and analyse them all. 

Angus

-- 
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 and 307 or 308 redirects with non GET methods

2014-06-07 Thread Angus Robertson - Magenta Systems Ltd
> Not easy to get it from the RFCs or from the online discussions, 
> but I've now checked how Firefox and Chrome are implementing it

Exactly, each browser has implemented redirection in different ways for
different requests, there is no general consensus

If you can just check MSIE as well, harder without source, we can be sure to
following most browsers. 

Angus

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

2014-06-07 Thread Angus Robertson - Magenta Systems Ltd
> I am trying to create a UDP listener for Windows platform and was 
> wondering, is it possible to receive UDP messages sent via Internet
> browsers from my UDP listener which is built with ICS?
> 
> If there are problems or something I should know, please let me 
> know!

Creating a UDP listener takes about five minutes, there are ICS samples that
show this, check readme8.txt. 

But internet browsers don't sent UDP messages, so you have a major conceptual
problem. 

Angus

-- 
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] Nagios like communication

2014-06-09 Thread Angus Robertson - Magenta Systems Ltd
> I would like to implement a new feature into one of my applications 
> where I can ask for a status
> through a (VPN)network connection, kind of like Nagios does.

Status of what? 

> Or maybe even build functionality into it so that it can be queried
> by Nagios.

Query what?  

Nagios is a Linux network monitoring tool, one of dozens, which I believe
variously uses SNMP, HTTP.  

Angus

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