EldoS | Feel safer!

Software components for data protection, secure storage and transfer

.NET TElHTTPSClient.Post takes a minute to return

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#28653
Posted: 03/03/2014 20:51:10
by Mike Gordon (Basic support level)
Joined: 03/03/2014
Posts: 2

I'm evaluating SecureBlackbox for a Windows Phone 7.5 application which uses HTTPS Post method. I use the OnData callback to get the response body and this returns in less than 5 seconds, but the Post call does not return for up to a minute.

Is there a way to control this timeout as the SocketTimeout has no effect on when the Post returns?

Code
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using SBHTTPSClient;
using SBSimpleSSL;
using SBStringList;

namespace SimpleHTTPSDemo
{
    public partial class MainPage : PhoneApplicationPage
    {
        private string ResponseBody = string.Empty;
        private TElHTTPSClient HTTPSClient = null;

        // Constructor
        public MainPage()
        {
            InitializeComponent();
            SBUtils.Unit.SetLicenseKey("Some Key");
        }

        private void btnConnect_Click(object sender, RoutedEventArgs e)
        {
            using (HTTPSClient = new SBHTTPSClient.TElHTTPSClient())
            {
                HTTPSClient.OnCertificateValidate += HTTPSClient_OnCertificateValidate;
                HTTPSClient.OnData += HTTPSClient_OnData;
                
                // Set up the form params
                TElStringList SL = new TElStringList();
                SL.Add("username", tbUsername.Text);
                SL.Add("password", tbPassword.Password);

                // Set up the stream to get the response
                Stream _os = new MemoryStream();
                HTTPSClient.OutputStream = _os;
                ResponseBody = string.Empty;

                int code = HTTPSClient.Post("https://www.example.com/pubs/m_login", SL);
                
                HTTP_Code.Text = code.ToString();

                HTTPSClient.OutputStream = null;
                _os.Close();
            }
        }

        void HTTPSClient_OnCertificateValidate(object Sender, SBX509.TElX509Certificate X509Certificate, ref SBUtils.TSBBoolean Validate)
        {
            Validate = true;
        }

        void HTTPSClient_OnData(object Sender, byte[] Buffer)
        {
            ResponseBody += Encoding.UTF8.GetString(Buffer, 0, Buffer.Length);
        }
    }
}
#28662
Posted: 03/04/2014 02:23:33
by Eugene Mayevski (EldoS Corp.)

Thank you for the report. The issue is server-specific and while it has been reported several times, we couldn't reproduce it. If you can give us the URL to test the code with (maybe in confidential HelpDesk), that would be great. Also there's a new build 246 on the site (just download the files, cause we have not yet updated version number and date) which *possibly* will solve the issue (we have grounds to expect that it does).


Sincerely yours
Eugene Mayevski
#28713
Posted: 03/07/2014 00:39:56
by Mike Gordon (Basic support level)
Joined: 03/03/2014
Posts: 2

Eugene,

I sent the web site URL through the Helpdesk link you provided. I also installed the 11.0.246 version and the result was unchanged--the POST call took approximately 60 seconds to return but the OnData callback had a server response within 5 seconds from the call to Post.
#28715
Posted: 03/07/2014 02:08:11
by Eugene Mayevski (EldoS Corp.)

Thank you for checking. We'll continue in HelpDesk where you have provided test info.


Sincerely yours
Eugene Mayevski
#30369
Posted: 08/14/2014 18:22:25
by David Steward (Standard support level)
Joined: 05/05/2009
Posts: 3

I also have this problem. Is there a timeout that can be set in Post?
#30370
Posted: 08/15/2014 01:58:18
by Eugene Mayevski (EldoS Corp.)

Mr.Steward, unfortunately this problem was never reproduced and thus never solved.

Timeout is set using SocketTimeout property, but the problem is not in timeout itself.

If you can help us by working with us on reproducing and fixing the issue, I will move your question to the HelpDesk and we'll try to investigate the problem deeper.


Sincerely yours
Eugene Mayevski
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

Topic viewed 1270 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!