OK, I have the whole thing setup and it works perfect when I use localhost as the ip. However, when I put in my ip, no one can connect to the program, including me. The messagebox pops up saying the server is not active... Any ideas?
Code:
Const READ_BUFFER_SIZE As Integer = 255
Const PORT_NUM As Integer = 9000
Private client As TcpClient
Private readBuffer(READ_BUFFER_SIZE) As Byte
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim frmConnectUser As New frmConnectUser
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
MsgBox("Server is not active. Please start server and try again.", _
MsgBoxStyle.Exclamation, Me.Text)
Me.Dispose()
End Try
lstUsers.Items.Clear()
SendData("REQUESTUSERS")
End Sub
Last edited by a moderator: