views:

18

answers:

0

I use SslStream with TcpClient in following way:

I call BeginRead() method and waiting for its results. When results come, I read them, call BeginRead() again and so on... Sometimes I need create another SslStream with this TcpClient, i.e. perform another ssl handshake.

How can I abort reading execution? It seams that if I try to call sslStream.Close() or sslStream.Dispose() it disconnects TcpClient. If I do nothing and it continue waiting for a data than I am not able to open new SslStream on this connection.

What can I do i such situation?