TCPClient and Asyncronous Socket Problem

  • Thread starter Thread starter alex002
  • Start date Start date
A

alex002

Dear all,

I am writing to a C# program to connect to the telnet server and getting
data; however, I know that I can use either TCPClient and Asyncronous Socket
to do the program. However, I don't know which is better and why. Can any
one tell me about this? Thank you for all of your help.

Alex
 
alex002 said:
I am writing to a C# program to connect to the telnet server and getting
data; however, I know that I can use either TCPClient and Asyncronous Socket
to do the program. However, I don't know which is better and why. Can any
one tell me about this? Thank you for all of your help.

Neither of them is better, they're just different. The TcpClient is a
somewhat more high-level class than the Socket class and a little bit easier
to work with. The Socket class is often considered to be a little bit more
difficult than the TcpClient class but offers more options.

Basically, it all depends on the programmer's taste. If you like working
with streams, the TcpClient is the best choice. If streams are not your
thing, you may want to check out the Socket class.

Regards,
Pieter Philippaerts
Managed SSL/TLS: http://www.mentalis.org/go.php?sl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top