No connection could be made because the target machine actively refused it 127.0.0.1:3446
"Actively refused it" means that the host sent a reset instead of an ack when you tried to connect. It is therefore not a problem in your code. Either there is a firewall blocking the connection or the process that is hosting the service is not listening on that port. This may be because it is not running at all or because it is listening on a different port.
Once you start the process hosting your service, try netstat -anb
(requires admin privileges) to verify that it is running and listening on the expected port.
update: On Linux you may need to do netstat -anp
instead.
No connection could be made because the target machine actively refused it Golang
net.Listen("tcp", "localhost:12345")
is listening on localhost
and client is trying to connect by IP.
Try connecting client on localhost
net.Dial("tcp", "localhost:12345")
Or listen the server on 0.0.0.0
net.Listen("tcp", "0.0.0.0:12345")
Win Error 10061 No connection could be made because the target machine actively refused it
when I try to run the server and client on different computers I get an error on the clients end
That is because you are using127.0.0.1
on both sides. That is the localhost loopback IP address. It works when the client and server are on the same machine, but it is not routable on the LAN network.
You need to:
change the server to listen on either
0.0.0.0
(to listen on all installed network interfaces), or its actual LAN IP address (just the network interface attached to the LAN).change the client to connect to the server's hostname or IP address on the LAN.
I have tried changing the port multiple times but it didn't help
The problem is nit with the port, but with the IP address.
No connection could be made because the target machine actively refused it Nethereum exception
My problem turned out to be that I had initialised the Web3() with no parameters, so it defaults to using localhost as the RPC client. I fixed it by initialising it with the RPC client url that I needed, in this case:
string rpcClient = "https://bsc-dataseed.binance.org/";
Web3 web3 = new Web3(rpcClient);
No connection could be made because the target machine actively refused it. [tcp://127.0.0.1:6037]
The redis server was not started and the port number was wrong in my env file
Related Topics
How to Run a Python Script from C#
What Is an Indexoutofrangeexception/Argumentouto
frangeexception and How to Fix It
How to Use Reflection to Call a Generic Method
Captured Variable in a Loop in C#
How to Properly Clean Up Excel Interop Objects
How to Detect Click/Touch Events on Ui and Gameobjects
How to Configure an App to Run Correctly on a Machine With a High Dpi Setting (E.G. 150%)
Dynamic Linq Orderby on Ienumerable≪T≫/Iqueryable≪T≫
Communicate Between Two Windows Forms in C#
Get Property Value from String Using Reflection
How to Deserialize Xml Document
C# Json.Net Convention That Follows Ruby Property Naming Conventions
Calling a Function from a String in C#
How to Get Started With Developing Internet Explorer Extensions
Cannot Convert from List≪Derivedclass≫ to List≪Baseclass≫