Results 1 to 7 of 7

Thread: VB.NET: Simple Connect and Disconnect using System.Net.Sockets...[Resolved]

Threaded View

  1. #1

    Thread Starter
    Addicted Member toytoy's Avatar
    Join Date
    Jul 2004
    Posts
    230

    VB.NET: Simple Connect and Disconnect using System.Net.Sockets...[Resolved]

    Say i have declare a module for connection and two buttons...

    one button has the method connect() and
    the other has the method disconnect()....

    how do i actually connect after i had disconnect my tcpC...
    I could not connect after i disconnect my connection...

    Code:
    Imports System.Net.Sockets 
    
    Module Connection 
    
        Dim tcpC As New TcpClient 
      
         Public Sub Connect() 
    
                 'Connect from this to the server at Port 6970 
                  Try 
                       tcpC.Connect("152.138.40.200", 6970) 
                  Catch e As Exception 
                       Console.WriteLine(e.ToString()) 
                  End Try 
        End Sub 
    
        Public Sub Disconnect() 
                tcpC.Close() 
        End Sub 
    
    End Module
    Thanks
    Last edited by toytoy; Dec 3rd, 2004 at 07:47 AM.

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