M
M.Perry
I am trying to set up two VB.NET Applications. One to sit
on the server and run and the other to sit on a client
computer and connect to the server application and for the
server application to send data to the client application.
Well, when I'm trying to connect to the server application
from the client application I get the followng error:
No connection could be made because the target machine
actively refused it.
But, when I try to just connect the two applications via
localhost to localhost it works just fine. Anyone who has
any ideas on how to correct this would be greatly
appreciated.
Thanks
M.Perry
The following set of code is how I set up the Server
Listener:
<DnsPermissionAttribute(SecurityAction.Demand,
Unrestricted:=True)> Public Class clTOAServer
Inherits MarshalByRefObject
Private thServer As Thread
Public Sub Main()
thServer = New Thread(AddressOf ServerListener)
thServer.Start()
End Sub
Public Sub ServerListener()
Const toaPortNum As Integer = 8080
Dim clientIP As IPAddress = IPAddress.Parse
("171.172.56.33")
Dim toaListener As New TcpListener(clientIP, toaPortNum)
toaListener.Start()
Try
Dim tcpClient As TcpClient = toaListener.AcceptTcpClient()
Catch
......
End Sub
The following is how I set up my client class to connect
to the server class:
Public Shared Property GetServerObjects()
Get
Dim aryReturnData As Array
Dim tcpClient As New System.Net.Sockets.TcpClient
Dim serverIP As IPAddress = IPAddress.Parse
("171.172.55.154")
tcpClient.Connect("171.172.55.154", 8080)
End Get
End Property
on the server and run and the other to sit on a client
computer and connect to the server application and for the
server application to send data to the client application.
Well, when I'm trying to connect to the server application
from the client application I get the followng error:
No connection could be made because the target machine
actively refused it.
But, when I try to just connect the two applications via
localhost to localhost it works just fine. Anyone who has
any ideas on how to correct this would be greatly
appreciated.
Thanks
M.Perry
The following set of code is how I set up the Server
Listener:
<DnsPermissionAttribute(SecurityAction.Demand,
Unrestricted:=True)> Public Class clTOAServer
Inherits MarshalByRefObject
Private thServer As Thread
Public Sub Main()
thServer = New Thread(AddressOf ServerListener)
thServer.Start()
End Sub
Public Sub ServerListener()
Const toaPortNum As Integer = 8080
Dim clientIP As IPAddress = IPAddress.Parse
("171.172.56.33")
Dim toaListener As New TcpListener(clientIP, toaPortNum)
toaListener.Start()
Try
Dim tcpClient As TcpClient = toaListener.AcceptTcpClient()
Catch
......
End Sub
The following is how I set up my client class to connect
to the server class:
Public Shared Property GetServerObjects()
Get
Dim aryReturnData As Array
Dim tcpClient As New System.Net.Sockets.TcpClient
Dim serverIP As IPAddress = IPAddress.Parse
("171.172.55.154")
tcpClient.Connect("171.172.55.154", 8080)
End Get
End Property