Socket class disadvantages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Piotrekk

    #1

    Socket class disadvantages

    Hi

    I have a question related to Socket class. What are the advantages /
    disadvantages of using Socket class comparing to TcpClient and
    HttpWebRequest

    Regards
    Piotr Ko³odziej
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Socket class disadvantages

    Piotr,

    Well, when using the TcpClient vs the Socket, you probably want to use
    the client most of the time, since it exposes the underlying Socket through
    the Client property.

    Now, comparing those to HttpWebRequest, with HttpWebRequest, it wraps
    all of the protocol interaction for you, forming the request, parsing the
    response, etc, etc. You don't have that with the TcpClient/Socket.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Piotrekk" <Piotr.Kolodzie j@gmail.comwrot e in message
    news:fda2a28b-b5e6-497f-936c-b0dbcc5a6d14@x6 9g2000hsx.googl egroups.com...
    Hi

    I have a question related to Socket class. What are the advantages /
    disadvantages of using Socket class comparing to TcpClient and
    HttpWebRequest

    Regards
    Piotr Ko³odziej

    Comment

    • Ben Voigt [C++ MVP]

      #3
      Re: Socket class disadvantages

      Socket can be used for UDP packets, the others can't.


      "Piotrekk" <Piotr.Kolodzie j@gmail.comwrot e in message
      news:fda2a28b-b5e6-497f-936c-b0dbcc5a6d14@x6 9g2000hsx.googl egroups.com...
      Hi

      I have a question related to Socket class. What are the advantages /
      disadvantages of using Socket class comparing to TcpClient and
      HttpWebRequest

      Regards
      Piotr Ko³odziej


      Comment

      Working...