I have a client / server application that communicates using WCF, which works great. One of the functions of the application is to receive files from client computers on the server (Central Control).
The central control requests a list of files in the specified folder on the client and opens the port using sockets for clients that connect to each file and transfer it. It uses a different port number for each file.
This worked fine when testing locally, but when deployed to our client environment, I started getting the following exception.
The requested address is not valid in its context
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at System.Net.Sockets.TcpListener.Start(Int32 backlog)
at System.Net.Sockets.TcpListener.Start()
at AMIGA.Library.TransferFile.listenerThread()
The IP address at the endpoint is the address 10 ... *. I was looking for an answer, and the general consensus was that tcpListener could not be associated with an external IP address. I did not think that 10 ... * the address was external.
The code that throws the exception is as follows:
tcpListener = New TcpListener(IEndPoint)
Dim handlerSocket As Socket
Dim thdHandler As Thread
tcpListener.Start()
RequestFile()
Can't I use a TcpListener for this job? What alternatives exist, if not, and how easy it would be to implement the alternatives.
Keep in mind that we do not have direct access to the firewall configuration, and the change may take several weeks.
source
share