troubleshooting Question

Asynchronous SSL TCP Listener

Avatar of any_suggestions
any_suggestions asked on
Smartphone ProgrammingSSL / HTTPSTCP/IP
2 Comments1 Solution1430 ViewsLast Modified:
Hi,

I have a TCP Socket Server program which, in summary, accepts connections from multiple concurrent clients, it asynchronously reads data from each client, processes the data and returns an acknowledgement to the client.
This is working fine, but I need the data to be sent/received over an SSL stream.
I don't think this is possible using the TCP Socket classes I am currently using??
But I think it should be possible if I use TCP Client and TCP Listener classes. However, at the moment it can accept connections asynchronously (using TCPListener.BeginAcceptTcpClient), but when I try to read the data asynchronously using the SSLStream.BeginRead it is not reading the data in the byte array correctly. It receives the correct number of bytes but all the data in the array is null.
The program works fine using the synchronous Read method using the same X509 Cert, so I don't think it is related to the cert.

I cannot find any good examples of this kind of code on the web, so any help is greatly appreciated.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros