|
-
Jun 6th, 2010, 07:49 AM
#1
Thread Starter
Hyperactive Member
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.
-
Jun 6th, 2010, 08:53 AM
#2
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.
-
Jun 6th, 2010, 02:08 PM
#3
Thread Starter
Hyperactive Member
Re: TCP send get data
ok thanks..will check now
Thanks for helping me out.
-
Jan 2nd, 2011, 03:57 AM
#4
New Member
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"
-
Jan 2nd, 2011, 04:11 AM
#5
Re: TCP send get data
 Originally Posted by fritz7110
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.
-
Jan 2nd, 2011, 04:13 AM
#6
Re: TCP send get data
 Originally Posted by fritz7110
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|