Madz Posted February 6, 2003 Posted February 6, 2003 Dear I am not getting an idea about how to handel this. i have a client server program, in which server listens for connections and client connects to server When a PC starts with client software it connects to server and in server list box it shows the avaiable list of connected clients. now here is a problem, if we close the server software and reopen the exe file we are unable to see list of clients which are connected on client it have tried to do this in timer that if server has closed the connections after every 3 seconds client try to check the status of connection if not cntoServer.state <> sckConnected then cntoServer.connect end if but it cause a run time error. can any one have any idea. Quote The one and only Dr. Madz eee-m@il
Spiro Posted February 7, 2003 Posted February 7, 2003 What is cntoServer? Do you use TCPListener and TCPClient or COM Winsock control? Quote
Fanell Posted February 9, 2003 Posted February 9, 2003 You are telling the program this: 'If you are connected, connect.' That makes no sense. :) Should be like this. If cntoServer.state <> sckConnected then cntoServer.Connect End if Or: If Not cntoServer.state = sckConnected Then cntoServer.Connect End If <> mean Not Equal To Good Luck. Quote
Madz Posted February 9, 2003 Author Posted February 9, 2003 Hello Dudes you have not checked my Coding i have written IF NOT cn.state = sckconnected Any how I have solved the problem using TCPCLIENT in normal it do not tell it's state i have to use it's protected property ACTIVE i made a class Imports System.Net.Sockets Public Class mClient Inherits TcpClient Public Property Connected() As Boolean Get If Me.Active = True Then Return True Else Return False End If End Get Set(ByVal Value As Boolean) End Set End Property End Class no i can check it as if Client.active = then try to connect it else exit sub end if Quote The one and only Dr. Madz eee-m@il
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.