none
message d'erreur : Received an unexpected EOF or 0 bytes from the transport stream. RRS feed

  • Question

  • Bonjour,
    J'ai le message d'erreur suivant avec certains serveurs : Received an unexpected EOF or 0 bytes from the transport stream.
    Vous pouvez trouver plus d'info sur ce message à la fin de ce post.

    Lorsque l'utilisateur clique sur le bouton, on envoie des informations à un serveur et recevoir une réponse.
    Avec certains serveurs mon application marche sans problème, avec certain, j'ai le message d'erreur ci-dessous

    Environnement : .NET framework 4.0 sous IIS 7, avec c#.net

    dans mon fichier de configuration (web.config)

     <appSettings>
            <add key="IdApp" value="#############"/>
            <add key="UrlDemandeReponse" value="https://nomserveur.com/toto/totop.php" />

    dans mon fichier cs :

    using System;
    using System.Data;
    using System.Collections;
    using System.ComponentModel;
    using System.Configuration;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Web.Mail;
    using System.Net;
    using System.IO;
    
    using System.Globalization; //pour specificCulture
    
    using MySql.Data;
    using MySql.Data.MySqlClient;
    
    
    //...
    
            protected void SubscribeButton_Click(object sender, System.EventArgs e)
            {
                
    // ma demande :
    	      string idApp = ConfigurationSettings.AppSettings["IdApp"];
                  string UrlDemandeReponse = ConfigurationSettings.AppSettings["UrlDemandeReponse"];
                  string constructionDemandeReponse = idApp + ",TOTO" + s.nomFamille + "=" + s.preNom + "?," + DateTime.Now.ToString("MMddyyyyHHmm");
    
                    
    	      UrlDemandeReponse += constructionDemandeReponse;
    
                  WebRequest request = WebRequest.Create(UrlDemandeReponse);
                  WebResponse response = request.GetResponse();
                  StreamReader reader = new StreamReader(response.GetResponseStream());
    
    string recuReponse;
    recuReponse = "";
                 string str = reader.ReadLine();
                  while (str != null)
                    {
                        recuReponse = recuReponse + str;
                        str = reader.ReadLine();
                    }
    
    // ...
    		string OkCode;
                    string ReponseObtenuRetour;
    //...
    
    
    
                 if (recuReponse.Substring((recuReponse.IndexOf("AB") + 2), 1) == "O")
                    {
                        OkCode = recuReponse.Substring((recuReponse.IndexOf("TA") + 2), 8);
    
    //continuer executer
    // engregistrement dans bd
    // engregistrement dans un fichier txt
    // envoyer un courriel de confirmation
    // affiche la nouvelle page (suivante)
                    }
                    else
                    {
    // affiche le message : corriger votre information, etc, 
                    }
    

    Est-ce que vous avez une idée pourquoi j'ai ce message avec  certain serveur, mais pas les autres

    Selon admin du serveur, qui produit cette erreur, c'est à cause de OpenSSL pourtant mon application c'est en c#
    Comment je peux remédier ce problème ?

    Merci

    ---------------------------------------------------------------------------------------------------------

    eceived an unexpected EOF or 0 bytes from the transport stream.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream.


    Stack Trace:

    [IOException: Received an unexpected EOF or 0 bytes from the transport stream.]
       System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) +6079466
       System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) +102
       System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) +85
       System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) +61
       System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) +137
       System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) +143
       System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) +99
       System.Net.TlsStream.CallProcessAuthentication(Object state) +47
       System.Threading.ExecutionContext.runTryCode(Object userData) +80
       System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) +0
       System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) +105
       System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) +125
       System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) +43
       System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result) +798
       System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) +58
       System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size) +26
       System.Net.ConnectStream.WriteHeaders(Boolean async) +139

    [WebException: The underlying connection was closed: An unexpected error occurred on a send.]
       System.Net.HttpWebRequest.GetResponse() +6038435
       CWeCommerce.ConfirmNewSub.SubscribeButton_Click(Object sender, EventArgs e) +998
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

    ________________________________________
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
    ------------------------------------------------------------------------

    jeudi 28 février 2013 20:51

Réponses

Toutes les réponses