Re: [twsocket] FTP Server example

2010-02-10 Thread David Rose


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

2010-02-10 Thread Angus Robertson - Magenta Systems Ltd
 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. 

If by exe you mean the same project and executable file, and you are not
already using threads, then the two applications are totally related,
only one will be running at a time.  

Again you don't actually say what you mean by 'database' , most people
would assume this means a database server engine like MS SQL, MySQL or
DB2 which you won't be compiling into your own executable.  But maybe you
have a lightweight internal database or some non-SQL engine? 

If you actually mean database client code accessing an external database,
all my previous comments stand, the FTP server will block during database
access.   

 I have a client program myapp.exe 

Irrelevant to this discussion.

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