Just to add to the above post , the read timeout error is :
"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)"
And the condition when it doesnt read any data is the error that I posted before.
Maybe you should try creating a VI to test your DLL. The test VI should call the method to create the connection and then write the reference to your FGV. After that, include a while loop with the SSL read and maybe a case structure that does the write if you click a button. It seems like you either have a bug in the DLL where the connection is getting lost or becoming invalid or a bug in the labview application with how you are using the DLL methods. The intention of the test VI is to see if it is something about your application that is causing the issue. If it all works in the test VI, then i would say that there might be a bug in your actual labview application.
Also try reapeating this test with an asynchronous read operation. I assume this means the DLL would need to be modified.
Other thoughts.....the server side may be timing out after not getting data from your client...
Possible work around .... http://social.msdn.microsoft.com/Forums/en-US/f4c3d019-aecd-4fc6-9dea-680f04faa900/sslstreamread-ret...
"Do you reestablish connection after getting exception?
"Caught IOException: Unable to read data from the transport connection: A co
nnection attempt failed because the connected party did not properly respond aft
er a period of time, or established connection failed because connected host has
failed to respond."
It indicates that a connection that is used by SslStream is no longer valid and its state maybe corrupted.
Best practice here would be closing the connection via .Close (Socket.Close or NetworkStream.Close) and then reestablishing it again. "
Thanks a ton for your inputs.
Regarding the post , I have tried all the suggested methods in that thread but nothing seems to work.
Also, I have not created any custom dll. I am using System DLL properties and methods itself for doing this SSL communication.
As far as re-establishing the connection is mentioned, I am closing the reference but with new connection also its unable to read.