0

I would like to know how to loop a connection or close an existing connection. heres the code i have to connect

Imports System.Net.Sockets
Public Class Form1
    Dim clientSocket As New System.Net.Sockets.TcpClient()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
clientSocket.Connect("ServerIp Goes Here", Server port goes here Catch ex As Exception
            Me.Close()
End Try
End Sub

Edited by Progr4mmer: n/a

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by Progr4mmer
0

What does "loop a connection" mean?

I mean like it keeps connecting over and over again

0

Why don't you explain what you're trying to accomplish? The behavior you're talking about is usually called "retrying" a connection. Retrying a connection or closing an existing connection are two very different tasks. It sounds like you're trying to plumb some kind of TCP connection class to connect to a server and send data?

0

Why don't you explain what you're trying to accomplish? The behavior you're talking about is usually called "retrying" a connection. Retrying a connection or closing an existing connection are two very different tasks. It sounds like you're trying to plumb some kind of TCP connection class to connect to a server and send data?

What i want it to do is connect disconnect connect disconnect ect.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.