VB.NET TCP/IP Communication 
Author Message
 VB.NET TCP/IP Communication

I am looking for sample code (perferable complete) that show how to use TCP
(winsock) in a client/server mode.  The server should handle multiple
conections.

I have a working VB.NET program I have been working on, but for some reason
it doesnt work the way I would expect it to.  It seems to freeze up and I
cant figure out what it happening.

I can share my app/code with anyone who would like to see what's going on
with it.

Martin Fletcher



Sun, 31 Jul 2005 08:47:12 GMT  
 VB.NET TCP/IP Communication
Actualy I am looking for ANYTHING to do with TCP and/or Client/Server code.

Martin Fletcher


Quote:
> I am looking for sample code (perferable complete) that show how to use
TCP
> (winsock) in a client/server mode.  The server should handle multiple
> conections.

> I have a working VB.NET program I have been working on, but for some
reason
> it doesnt work the way I would expect it to.  It seems to freeze up and I
> cant figure out what it happening.

> I can share my app/code with anyone who would like to see what's going on
> with it.

> Martin Fletcher



Sun, 31 Jul 2005 09:22:30 GMT  
 VB.NET TCP/IP Communication
Hi Martin:

Here's a core client connect using tcpclient:

First, you're going to need:

Imports system.net.sockets

You can use this to create connections to smtp, pop3, nntp and many others
Dim MyClient as  TcpClient = new TcpClient(ServerName, portnumber)

Once you make the connection, you need to manage buffer io

Dim Data as String
Dim szData() as Byte
Dim sLine as String

Now, for a bit of logic with respect to the above connection:

If isnothing(MyClient) = true then
'notify the user that the connection failed

else

'find out what the server responded with

Dim NetStrm as NetworkStream = MyClient.GetStream()
Dim Rdr as StreamReader = new StreamReader(MyClient.GetStream())
sLine = rdr.ReadLine()

End If

Each server type has its own way of talking back.

in the case of a newsreader, for example, the server will come back with a
200 or 201
-- meaning okay to post or not okay to post and, if the username and
password is necessary,
the server will let you know about that as well.

hth


Quote:
> Actualy I am looking for ANYTHING to do with TCP and/or Client/Server
code.

> Martin Fletcher



> > I am looking for sample code (perferable complete) that show how to use
> TCP
> > (winsock) in a client/server mode.  The server should handle multiple
> > conections.

> > I have a working VB.NET program I have been working on, but for some
> reason
> > it doesnt work the way I would expect it to.  It seems to freeze up and
I
> > cant figure out what it happening.

> > I can share my app/code with anyone who would like to see what's going
on
> > with it.

> > Martin Fletcher



Mon, 01 Aug 2005 16:56:22 GMT  
 VB.NET TCP/IP Communication


Quote:
> I am looking for sample code (perferable complete) that show how to use
TCP
> (winsock) in a client/server mode.  The server should handle multiple
> conections.

> I have a working VB.NET program I have been working on, but for some
reason
> it doesnt work the way I would expect it to.  It seems to freeze up and I
> cant figure out what it happening.

the samples on http://www.abstractvb.com might be too elementary ... but
I'll let you decide ...


Sun, 21 Aug 2005 00:40:02 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. TCP/IP release renew in VB.net or C#

2. TCP/IP Client and Server in VB .net example

3. Transactions using VB 3.0/ODBC Q+E/Sql*NET TCP-IP/Oracle 7

4. TCP/IP communications

5. TCP/IP Communications With QB 4.5

6. Question serial communications (BBS and TCP/IP)

7. Communication between two PCs with TCP/IP

8. TCP/IP communication with VB5/6

9. TCP/IP Socket communication DLL/Control??

10. Help Please - VB5 and Asynch TCP/IP Communication

11. Help Please - VB5 and Asynch TCP/IP Communication

12. Help Please - VB5 and Asynch TCP/IP Communication

 

 
Powered by phpBB® Forum Software