Sending data using NetWorkStream in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dtittle
    New Member
    • Jan 2008
    • 8

    Sending data using NetWorkStream in C#

    Hi,

    I am working on a C# app for a mobile 05 device that will send data to a server. I think I need to use the NetWorkStream to send it via TCP but I'm not sure how to do that. The book that I am using is not very clear on that subject. Can anyone help?

    Thanks,
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    That is sort of a broad subject.
    The only time I have seen NetworkStream used is on wrapped Socket classes (TcpClient, TcpListener, etc)
    Have you established the protocol you want to use to talk between devices? Like are you going to writing your own? Use http? Use FTP? etc?

    Comment

    • dtittle
      New Member
      • Jan 2008
      • 8

      #3
      Yes, this is a broad question, because I have no clue as to what I'm doing. I found in my book that I could use NetWorkStream to send data to a server. If someone could point me in a good direction to go with this, I'd appreciate it. What would be the best way to send data from a mobile device to a server?

      Protocol????? I guess TCP.
      Last edited by dtittle; Oct 27 '08, 04:54 PM. Reason: adding to answer

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Well what kind of data is the server expecting?
        If the server expects things to come in as http request, you could use the HttpWebRequest class.
        If you are developing your own communication, just look at the TcpClient/TcpListener classes. (They are wrapper classes for the Socket class, which you could also use if you are more comfortable using Sockets like you would in c++)

        Comment

        Working...