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.