"PiotrKolodziej" <(E-Mail Removed)> wrote:
> What is the difference in using above functions?
> They have the same description. Is there any common practice, when to use
> one of them and where we shouldn't?
TcpClient is a higher-level interface, while Socket is a lower-level
interface. TcpClient simply wraps a non-server TCP socket (i.e. a socket
that isn't listening).
The socket is always available through TcpClient.Client, so you don't
lose anything by going with TcpClient (this wasn't the case with .NET
1.1 and before, where TcpClient.Client was protected, IIRC).
If you're comfortable with working with the Socket class, you don't lose
anything by going with it alone. For example, to get a stream attached
to the read and write of the socket, you can new up a NetworkStream
around the socket.
-- Barry
--
http://barrkel.blogspot.com/