EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Standard FTP using TElFTPServer

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#35369
Posted: 01/04/2016 17:30:29
by Scott Elder (Basic support level)
Joined: 01/04/2016
Posts: 3

Hello,

I'm working with (Evaluating) TElFTPSServer and running into a few problems. First of all, I am unable to use TElSimpleFTPSServer for several reasons, so this is not an option.

I am monitoring connections with a standard TcpListener and creating an instance of TElFTPSServer once a connection is made - passing in the socket and registering for every event on TElFTPSServer. I'm implementing all events to learn the flow of how the API works.

The only property being set is the MessageTable - I'm creating a new instance and setting the defaults with a call to SetDefaults(). I am not using any encryption at all since I am just trying to get standard FTP working for now. Later I will need SSL/TLS support.

The connection works fine, but locks up waiting for the Welcome Message. This happens on all three of the FTP Clients I am using (FZ, CuteFtp, and command line).

After the connection is accepted, the first message to fire is OnBeforeSendReply. This contains the welcome message. The next message that fires is OnCommandProcessed. This contains the status 220 ReplyCode. No other events or errors happen after that event returns.

Log-
Status: Connecting to 127.0.0.1:21...
Status: Connection established, waiting for welcome message...

Thanks in advance!

Scott
#35370
Posted: 01/04/2016 18:10:02
by Eugene Mayevski (EldoS Corp.)

Just event handlers will not be enough. You need to call Open() method of TElFTPSServer class as soon as the socket connection is established. Next, when you have any incoming data in the socket, call TElFTPSServer.DataAvailable() method. This call will make the server instance request the data (via the callback) and act further.

Could you please tell me, what edition of SecureBlackbox are you testing?


Sincerely yours
Eugene Mayevski
#35371
Posted: 01/04/2016 19:08:48
by Scott Elder (Basic support level)
Joined: 01/04/2016
Posts: 3

I should have been more specific. I am calling Open directly after the connection is established. Further, I have a monitoring loop looking for data. When data arrives, I do call DataAvailable(). I've copied my listening loop below. As for the edition of SBB that I am using:

Version: 14.0.286.0
Downloaded from Nuget on December 28th.
License Key: the one included with the nuget package

Code
private void ReadLoop()
        {
            bool error = false;
            try
            {
                try
                {
                    Monitor.Enter(_lock);
                    _ftpServer.Open();
                }
                finally
                {
                    Monitor.Exit(_lock);
                }

                while (_socket != null && _socket.Connected && !error)
                {
                    if (_socket.Poll(1000000, SelectMode.SelectRead))
                    {
                        try
                        {
                            Monitor.Enter(_lock);
                            _ftpServer.DataAvailable();
                        }
                        finally
                        {
                            Monitor.Exit(_lock);
                        }
                        Thread.Sleep(0);
                    }
                }
            }
            catch (Exception e)
            {

            }
        }
#35372
Posted: 01/04/2016 19:17:12
by Eugene Mayevski (EldoS Corp.)

Thank you for the details. As the most obvious causes are excluded, it makes sense to analyze the complete code.

Are you building some proof-of-concept project that you can send us for checking?
If yes, please just tell me here, and I will create a HelpDesk ticket from your question. You will be able to post your code to that helpdesk ticket.


Sincerely yours
Eugene Mayevski
#35373
Posted: 01/04/2016 19:21:48
by Scott Elder (Basic support level)
Joined: 01/04/2016
Posts: 3

Yes, this is proof of concept but it is somewhat embedded in a larger application. I will carve out the relevant code and create a console application that I can send you after the ticket is created.

Thank you.
#35374
Posted: 01/04/2016 19:33:05
by Eugene Mayevski (EldoS Corp.)

Great. I have created the helpdesk ticket. You will see it simply by going to https://www.eldos.com/helpdesk/ . Please note that while I am in the US and still working, the developers are in Europe so they will be able to check your code only tomorrow.


Sincerely yours
Eugene Mayevski
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

Topic viewed 2090 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!