Hi all,
I am modifying the VB.NET How-To Sockets Client program for a little project.
The first thing this program does is create a new tcp client to connect to the server program. If the server is down it displays a message "Server is down"
Before the connection is made I have opened a new form which I want to display these messages. However for some wierd reason the form doesent completly load until after connection is made or failed. I have posted the code below.
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim frmConnectUser As New frmConnectUser()
Dim frmSplash As New frmSplash()
frmSplash.Show()
frmSplash.label1.text = "Connecting"
Try
client = New TcpClient("localhost", PORT_NUM)
client.GetStream.BeginRead(readBuffer, 0, READ_BUFFER_SIZE, AddressOf DoRead, Nothing)
me.show
AttemptLogin()
Catch Ex As Exception
Me.Dispose()
End Try
End Sub
I dont see the "Connecting" label until after the program has either established a connection or failed.
Can somebody help me.
Thanks
I am modifying the VB.NET How-To Sockets Client program for a little project.
The first thing this program does is create a new tcp client to connect to the server program. If the server is down it displays a message "Server is down"
Before the connection is made I have opened a new form which I want to display these messages. However for some wierd reason the form doesent completly load until after connection is made or failed. I have posted the code below.
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim frmConnectUser As New frmConnectUser()
Dim frmSplash As New frmSplash()
frmSplash.Show()
frmSplash.label1.text = "Connecting"
Try
client = New TcpClient("localhost", PORT_NUM)
client.GetStream.BeginRead(readBuffer, 0, READ_BUFFER_SIZE, AddressOf DoRead, Nothing)
me.show
AttemptLogin()
Catch Ex As Exception
Me.Dispose()
End Try
End Sub
I dont see the "Connecting" label until after the program has either established a connection or failed.
Can somebody help me.
Thanks