none
SSLStream.Read() method unexpected state RRS feed

  • Question

  • Hi,

    I am building an desktop application that requires to be a SSL Server via TCP/IP communication.

    Initially everything is working fine. I am able to start the listener, connect to a SSL client, send/receive data using SSL Stream.

    But after sometime, I am unable to read data from the SSL Stream. The data is available at the port but somehow its unable to read it. I am able to send the data without any error.

    Can anyone suggest anything ?

    Regards,

    Runjhun.

    Thursday, December 19, 2013 5:28 AM

All replies

  • Hi Runjhun,

    You should provide some more information for troubleshooting. Please see the following link for production debugging. http://msdn.microsoft.com/en-us/library/ee817659.aspx#dbgch01_debuggingtools.

    http://msdn.microsoft.com/en-us/library/ff650691.aspx.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 20, 2013 3:38 AM
    Moderator
  • Hi,

    I am getting the timeout error from Synchronous SSL Read as

    Error calling method System.Net.Security.SslStream.Read, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

    Inner Exception: System.IO.IOException: Unable to read data from the transport connection: A non-blocking socket operation could not be completed immediately.

    Inner Exception: System.Net.Sockets.SocketException: A non-blocking socket operation could not be completed immediately)".

    Initially client sends some data to the server port at a definite interval. Then, server starts dumping some data to client which is at random interval. After this, the SSL Read function is not returning any valid data even though data is available at the port. On the other hand, even after that, it is successfully able to write the data to client.

    Any clues.

    Friday, December 20, 2013 4:04 AM
  • Hi Runjhun,

    I don’t know what kind of non-blocking-polling socket calls are you using, but I would recommend that you use the Async socket calls. See the following link for details. http://stackoverflow.com/questions/5764921/whats-the-difference-between-beginconnect-and-connectasync.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 23, 2013 8:17 AM
    Moderator
  • Hi,

    The problem here is I cant use asynchronous calls in my application. I have to go with the synchronous method only.

    Friday, January 10, 2014 8:55 AM