Results 1 to 6 of 6

Thread: TCP send get data

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2008
    Posts
    353

    TCP send get data

    Hi guys,

    I wanted to ask a thing...

    well i use winsock6 in vb6...and i've used getdata,sendtada,connect,listen.ecc....


    today i started using vs 2010 and i dont know where to start and what to use to do the same things as in vb6

    any tip?

    cheers
    Thanks for helping me out.

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

    Re: TCP send get data

    Like so many things in VB.NET compared to VB6, network communication is done in a far more object-oriented way. Instead of one "super class" that does everything, there are multiple classes that each have a well-defined purpose, obeying the "single responsibility principle". As a first option, consider using the TcpListener class to accept incoming connections, the TcpClient class to create the connection and the NetworkStream class to perform the actual communication. There's also the Socket class for more fine-grained control. You might like to follow the CodeBank link in my signature and check out my Asynchronous TCP demo, which shows the use of all three to asynchronously communicate between a server and multiple clients.
    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

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2008
    Posts
    353

    Re: TCP send get data

    ok thanks..will check now
    Thanks for helping me out.

  4. #4
    New Member
    Join Date
    Jan 2011
    Posts
    1

    Re: TCP send get data

    Hello

    I am not 100% new to VB but now i start using VB2010 now

    and saw that winsock is not working anymore

    basicly I need only to send 6 chars to an extern device

    can some help me for this?

    reciveing will be only a string.



    I can not see the link for the "Asynchronous TCP demo"

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

    Re: TCP send get data

    Quote Originally Posted by fritz7110 View Post
    I can not see the link for the "Asynchronous TCP demo"
    Look a bit more carefully. There is a link in my signature that lists my VB CodeBank threads. That list includes one on asynchronous TCP communication.
    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

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

    Re: TCP send get data

    Quote Originally Posted by fritz7110 View Post
    Hello

    I am not 100% new to VB but now i start using VB2010 now

    and saw that winsock is not working anymore

    basicly I need only to send 6 chars to an extern device

    can some help me for this?

    reciveing will be only a string.



    I can not see the link for the "Asynchronous TCP demo"
    That asynchronous TCP thread is probably overkill for what you want. You should probably just use the corresponding synchronous methods, which are simpler. If you look around the web, you should be able to find plenty of examples of using the TcpListener and TcpClient classes.
    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