News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
Architecture Question  
by TonyC
posted on 2004/04/10

I'm new to this library and SSL as a whole. I am looking for a good insertion point for my design. Currently we are useing the System.Net.Sockets.TcpClient and TcpListener for communications and was expecting to see a SecureTcpClient class that derived from TcpClient. Design wise it seems that their is no common base class that my software can abstract to a common level since some clients will use SSL and others will not at the same time. Design wise it seems that I can not have both at this same time. Any suggestions?

by TonyC
posted on 2004/04/12

Anybody home?

by Jason
posted on 2004/04/27

Isn't the TcpClient class sealed?

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2004/05/13

The common base class that your software can abstract to is System.Stream. Both NetworkStream and SecureNetworkStream inherit this class.

We didn't inherit from TcpClient because most methods of this class are non-virtual, which basically means that if you do something like this:
TcpClient tc = new SecureTcpClient(...);
Stream s = tc.GetStream();
the 's' variable will contain a NetworkStream instead of the expected SecureNetworkStream.

Also note that the SecureSocket can handle both secure and non-secure connections. If you create a SecureSocket with the SecureProtocol set to SecureProtocol.None, the SecureSocket object is equivalent to a normal Socket object.

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.