Results 1 to 5 of 5

Thread: TCP Receiving/Sending data

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2009
    Posts
    198

    TCP Receiving/Sending data

    Im woundering how does Receiving/Sending data work in a TCPClient/Server that is connected in the same networkstream.


    Ps: is there any examples/Tuts?


    Thanks!

  2. #2
    Addicted Member macuiare's Avatar
    Join Date
    Jan 2009
    Posts
    229

    Re: TCP Receiving/Sending data

    Theres Plently of tutorials out there, as they say happiness is just a google search away :P

    http://www.google.co.nz/search?hl=en...meta=&aq=f&oq=

    Macuiare

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: TCP Receiving/Sending data

    A NetworkStream is a Stream like any other. You call a Write method to put data in and a Read method to get data out. You can call synchronous methods that will block until the operation is complete, or you can call asynchronous methods that will allow you to keep processing and invoke a callback when the operation completes. Asynchronous methods are particularly useful at the receiving end, where you might be waiting for some time for data. You might like to follow the Asynchronous link in my signature and see my fully asynchronous implementation of a server and client that exchange text message over TCP.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Mar 2009
    Posts
    198

    Re: TCP Receiving/Sending data

    Hum, Is it possible for a tcp listener to Receiving/Sending data like reading the same network stream.


    EX: TcpClient send text(Example) to the server. The server then reads it and prints it on a richtextbox. And the server sends text to the client and it reads it but be in the same networkstream.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: TCP Receiving/Sending data

    Quote Originally Posted by WhatAmIDoing View Post
    Hum, Is it possible for a tcp listener to Receiving/Sending data like reading the same network stream.


    EX: TcpClient send text(Example) to the server. The server then reads it and prints it on a richtextbox. And the server sends text to the client and it reads it but be in the same networkstream.
    The link that I've already directed you to answers that question.
    Last edited by jmcilhinney; Nov 11th, 2009 at 05:43 AM.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width