Re: [twsocket] FTP Server example
Hello Angus, ARMSL If by exe you mean the same project and executable file, and you are not ARMSL already using threads, then the two applications are totally related, ARMSL only one will be running at a time. Yes, one delphi project producing one exe. ARMSL Again you don't actually say what you mean by 'database' , most people ARMSL would assume this means a database server engine like MS SQL, MySQL or ARMSL DB2 which you won't be compiling into your own executable. But maybe you ARMSL have a lightweight internal database or some non-SQL engine? I'm talking about building the FTP server functionality into a compiled NexusDB database server. So the server engine (which in itself is already multithreaded) will contain the FTPServer component. Can I create a thread and instantiate the FTPserver component within that thread ? Will this help ? Many thanks for your answers so far. David David Rose Navigator Systems Ltd, Network Business Centre, 3 Gloucester Street, Bath, BA1 2SE,UK Main Tel: +44 (0)207 183 0011 Fax: +44 (0)1225 464984 Company Email: da...@navigator.co.uk (Private e-mail on request) CONFIDENTIALITY NOTICE The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender by replying to this message. -- 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 Server example
Hello Angus, Many thanks. Is there anything specific to running this component in a thread I need to be aware of (I'm aware of general thread principles) ARMSL Unless you expect a performance issue, it's probably not worth the ARMSL trouble. I think you're right. I won't do anything about it until it turns out to be a problem. Though I'll make sure I know what I need to do IYSWIM. -- regards David Thursday, February 11, 2010, 11:59:00 AM, you wrote: Can I create a thread and instantiate the FTPserver component within that thread ? Will this help ? ARMSL Yes, you can create the FTP server within a thread, but there are ARMSL currently no ICS demos doing so. ARMSL Unless you expect a performance issue, it's probably not worth the ARMSL trouble. ARMSL Angus ARMSL -- ARMSL To unsubscribe or change your settings for TWSocket mailing list ARMSL please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket ARMSL Visit our website at http://www.overbyte.be David Rose Navigator Systems Ltd, Network Business Centre, 3 Gloucester Street, Bath, BA1 2SE,UK Main Tel: +44 (0)207 183 0011 Fax: +44 (0)1225 464984 Company Email: da...@navigator.co.uk (Private e-mail on request) CONFIDENTIALITY NOTICE The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender by replying to this message. -- 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 Server example
Hello Angus, I don't think I explained properly. The FTP server and Database are completely unrelated except for the fact that they share the same exe. In an ideal world, they'd be two completely independent exe's but the spec of this program means that one exe has got to be both a database engine and an FTP server. However the FTP server isn't doing very much I have a client program myapp.exe which when it starts logs into the FTP server to see if there is an updated version of itself, if there is, then it downloads it, if there's not, then it logs off the ftp server and gets on with being a database client app. So all the FTP server is doing is supplying a directory listing to myprogram.exe and then with an updated exe if one exists. The FTP server and database NEVER talk to each other. -- regards David Tuesday, February 9, 2010, 2:44:00 PM, you wrote: ARMSL Your server application also needs to take care with file lock timeouts, ARMSL network timeouts, etc, to avoid blocking the main thread. Could you elaborate. I know very little about this subject. ARMSL Provided you do not make database calls from any FTP server events, you ARMSL will not have a problem. Generally, making simple database calls is ARMSL painless since they usually respond within 20ms and that is the time ARMSL during which the FTP server will stop responding to all clients. But you ARMSL would not want to do a complex database query that took any longer ARMSL without using a thread. ARMSL But if the database needs to be re-opened and there is a network problem ARMSL (since real databases are never on the same platform as an FTP server) ARMSL there may be a 30 second timeout before the connection fails, and that ARMSL means the FTP server also stops for 30 seconds. ARMSL One of my applications used async database events, both opening and ARMSL executing statements, with a queue for new statements that are needed ARMSL before previous ones have completed, with a trigger emptying the queue, ARMSL but it all gets very complicated, particularly the error handling. ARMSL My FTP servers also log to a database, but this is very fast since it ARMSL mostly does not need the response to be interpreted. ARMSL The same issues apply to file event logging, opening a file on a network ARMSL share may have a long timeout, during which the server is blocked. ARMSL Angus ARMSL -- ARMSL To unsubscribe or change your settings for TWSocket mailing list ARMSL please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket ARMSL Visit our website at http://www.overbyte.be David Rose Navigator Systems Ltd, Network Business Centre, 3 Gloucester Street, Bath, BA1 2SE,UK Main Tel: +44 (0)207 183 0011 Fax: +44 (0)1225 464984 Company Email: da...@navigator.co.uk (Private e-mail on request) CONFIDENTIALITY NOTICE The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender by replying to this message. -- 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 Server example
ARMSL Your server application also needs to take care with file lock timeouts, ARMSL network timeouts, etc, to avoid blocking the main thread. Could you elaborate. I know very little about this subject. I just need the simplest way to act as a simple FTP server. I will be controlling both the files it's serving (max size will be about 10MB) and the client software connecting, but the server is part of a database engine, so I need to be sure that some FTP action isn't going to hold up the database functions. Basically the FTP server part is used by our client autoupdate mechanism. The Database Server program downloads any updates to our client program from our internet based server and presents the downloaded info to the Admin. If the Admin decides that he wants the clients updated to this new release, he 'publishes' the update files - which basically means making sure the FTP server component is aware of them. Next time a client starts, it checks the local FTP site (i.e the database engine program) to see if there is an update, and if so, it downloads it and updates itself. Most system have about 5-10 clients (though some have a 100) and I suppose the worst time will be the Monday morning following an update when all the clients try to update themselves at once. David Rose Navigator Systems Ltd, Network Business Centre, 3 Gloucester Street, Bath, BA1 2SE,UK Main Tel: +44 (0)207 183 0011 Fax: +44 (0)1225 464984 Company Email: da...@navigator.co.uk (Private e-mail on request) CONFIDENTIALITY NOTICE The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender by replying to this message. -- 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 Server example
Hello Francois, Ok, thanks, but is there any reason why the processing of the delivery of the file takes place in the OnTerminate event, rather than at the end of the execute method i.e after the call to the lengthy process. -- regards David Thursday, January 28, 2010, 4:56:24 PM, you wrote: I've been looking at the FTPServ1 sample app and I don't quite understand the worker thread part of the Getprocessing routine . Why is the data sent in the OnTerminate event rather than the execute method ? FP The idea is to have the FTP server trigger some lengthy processing (here a FP simple 10 sec sleep for the demo, but could be a very long database query) FP to produce some data in response to a ftp get. This shows that the server FP keep servicing other clients while processing take place in a thread. FP -- FP francois.pie...@overbyte.be FP The author of the freeware multi-tier middleware MidWare FP The author of the freeware Internet Component Suite (ICS) FP http://www.overbyte.be FP -- FP To unsubscribe or change your settings for TWSocket mailing list FP please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket FP Visit our website at http://www.overbyte.be David Rose Navigator Systems Ltd, Network Business Centre, 3 Gloucester Street, Bath, BA1 2SE,UK Main Tel: +44 (0)207 183 0011 Fax: +44 (0)1225 464984 Company Email: da...@navigator.co.uk (Private e-mail on request) CONFIDENTIALITY NOTICE The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender by replying to this message. -- 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 Server example
AG Only if socket IO actually was a bottleneck it might make sense AG to use a different thread design, something like around 100 AG clients per thread, for example. You'll have to bare with my questions on this as this is a subject I don't really know yet. If my main app (which contains an TFtpServer component) is working hard processing data and a client requests a large file, does the main app stop processing its data whilst the file is being sent ? What if 25 users request the same large file ? If it does stop, then what do I need to do to make sure that it doesn't ? David Rose Navigator Systems Ltd, Network Business Centre, 3 Gloucester Street, Bath, BA1 2SE,UK Main Tel: +44 (0)207 183 0011 Fax: +44 (0)1225 464984 Company Email: da...@navigator.co.uk (Private e-mail on request) CONFIDENTIALITY NOTICE The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender by replying to this message. -- 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 Server example
I've been looking at the FTPServ1 sample app and I don't quite understand the worker thread part of the Getprocessing routine . Why is the data sent in the OnTerminate event rather than the execute method ? regards David David Rose Navigator Systems Ltd, Network Business Centre, 3 Gloucester Street, Bath, BA1 2SE,UK Main Tel: +44 (0)207 183 0011 Fax: +44 (0)7000 NAVFAX (628329) Company Email: da...@navigator.co.uk (Private e-mail on request) CONFIDENTIALITY NOTICE The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender by replying to this message. -- 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: SMTP tray program
Before I reinvent the wheel I have a program here which sends email via SMTP but doesn't support authentication. I also have an ISP which only allows authenticated SMTP. Does anyone know of a little app which I can run locally on my PC (either as a service or a tray app) which will act as a little SMTP relay to get around this problem ? (Actually 'I' in the above is a non-technical customer of mine) regards David David Rose Navigator Systems Ltd, Network Business Centre, 3 Gloucester Street, Bath, BA1 2SE,UK Main Tel: +44 (0)7000 NAVSYS (628797) Fax: +44 (0)7000 NAVFAX (628329) Company Email: [EMAIL PROTECTED] (Private e-mail on request) CONFIDENTIALITY NOTICE The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender by replying to this message. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] Sending Mail using MX records
Am I correct in thinking that the SMTP client component does not support natively sending mail using MX records ? In other words if I want to send mail using MX records I'd have to do a DNS lookup on the recipients email address then connect to that server using the SMTP client component, send the email, disconnect and then repeat for any other TO, CC or BCC addresses ? If this is the case, I don't suppose anyone has any sample code where they might have already done something like this ? I searched the archives and found some code to get the MX record from a DNS server, but nothing more. regards David David Rose Navigator Systems Ltd, Network Business Centre, 3 Gloucester Street, Bath, BA1 2SE,UK Main Tel: +44 (0)7000 NAVSYS (628797) Fax: +44 (0)7000 NAVFAX (628329) Company Email: [EMAIL PROTECTED] (Private e-mail on request) CONFIDENTIALITY NOTICE The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender by replying to this message. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] FTPClient ASCII or Binary ?
Is there something wrong with the code below. As far as I understand it should be uploading in binary mode, but the FTP conversation looks like it's in ASCII mode, though the (23MB) file does seem to upload correctly. If I try something like FTPexplorer then the FTP log does show Opening BINARY mode ., so presumably it's not the server reporting wrongly or does the client generate the message text from the status number ? if FTPClient1.Cwd() then begin if not (FTPClient1.Binary) then begin FTPClient1.Binary := true; FTPClient1.TypeSet(); end; FTPClient1.dele; FTPClient1.put; end; CWD /anon_ftp/pub/RentalDesk_NX/ 250 CWD command successful DELE RentalDeskNXWorkStation.EXE 250 DELE command successful PORT 192,168,42,215,18,32 200 PORT command successful STOR RentalDeskNXWorkStation.EXE 150 Opening ASCII mode data connection for RentalDeskNXWorkStation.EXE regards David David Rose Navigator Systems Ltd, Network Business Centre, 3 Gloucester Street, Bath, BA1 2SE,UK Main Tel: +44 (0)7000 NAVSYS (628797) Fax: +44 (0)7000 NAVFAX (628329) Company Email: [EMAIL PROTECTED] (Private e-mail on request) CONFIDENTIALITY NOTICE The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender by replying to this message. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] FTP Client
99 times out of 100 the quit command works correctly, but on the other time FTPClient1.Quit returns false. The time between the two codesite messages is about 300ms, so I'm presuming that it's not due to a time out. What else can result in this function returning false so quickly ? Try codesite.send(FtpClient1.LastResponse) it will probably tell you the reason why Quit failed. Thanks, that gives an error of 500 Control connection closed. Connection aborted (Winsock error #10053) Can anyone tell me what that means ? regards David David Rose Navigator Systems Ltd, Network Business Centre, 3 Gloucester Street, Bath, BA1 2SE,UK Main Tel: +44 (0)7000 NAVSYS (628797) Fax: +44 (0)7000 NAVFAX (628329) Company Email: [EMAIL PROTECTED] (Private e-mail on request) CONFIDENTIALITY NOTICE The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender by replying to this message. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] FTP Client
Please try using FtpCli v2.100 or later (beta dated September 2005 or later), it contains a fix for a problem uploading small files, and the problem may have caused other issues Thanks, same problem. It seems that the error is 500 Control connection closed. Connection aborted (Winsock error #10053) regards David David Rose Navigator Systems Ltd, Network Business Centre, 3 Gloucester Street, Bath, BA1 2SE,UK Main Tel: +44 (0)7000 NAVSYS (628797) Fax: +44 (0)7000 NAVFAX (628329) Company Email: [EMAIL PROTECTED] (Private e-mail on request) CONFIDENTIALITY NOTICE The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender by replying to this message. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] FTP client stalling
I've discovered that if I drop the MTU on the Xp machine to 1352, then the file seems to be sent correctly without any stalling. Don't know why this should suddenly have become an issue, presumably a Windows update or something strange set upstream by the ISP ? regards David -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] FTP client stalling
I have written a simple program to upload some files from my PC to our FTP site. Basically once a new build of our software is complete, the program kicks in to upload the files. However about 75% of the time, the upload stalls after 8760 bytes. As far as I can see (from Google) this is a magic number with TCP/IP under windows. If I try and upload the same files to the same location using a commercial FTP program, then it never seems to have a problem, so I'm assuming that it either doesn't stall or internally copes with the stall without reporting it to me. Any suggestions ? These are the properties of the component and below is the simple code I'm using to operate it. Delphi 5, FTPClient seems to be Version: 2.86 object FtpClient1: TFtpClient Timeout = 60 MultiThreaded = False HostName = 'ftp.navigator.co.uk' Port = 'ftp' LocalAddr = '0.0.0.0' UserName = -removed from posting PassWord = -removed from posting HostDirName = '/' DisplayFileFlag = True Binary = False ShareMode = ftpShareCompat Options = [ftpAcceptLF] ConnectionType = ftpDirect OnCommand = FtpClient1Command OnProgress = FtpClient1Progress OnSessionConnected = FtpClient1SessionConnected OnSessionClosed = FtpClient1SessionClosed OnRequestDone = FtpClient1RequestDone OnBgException = FtpClient1BgException Left = 288 Top = 77 end FTPClient1.connect; FTPClient1.HostDirName := paramstr(1); FTPClient1.HostFileName := paramstr(3); FTPClient1.localfilename := paramstr(2); if FTPClient1.Cwd() then begin if not (FTPClient1.Binary) then begin FTPClient1.Binary := true; FTPClient1.TypeSet(); end; FTPClient1.dele; FTPClient1.put; All the FTPClient1 events write to a Tmemo to report the progress/status. regards David -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be