I want to write a small groovy script.
This is my script, which is working:
s = new Socket("localhost", 1234);
s << "RUN"
s.close()
But I don't want to use the hostname (here it is 'localhost'), I want to use the IP-Adress, but if I write the following Code it doesn't work.
s = new Socket("xx.x.xx.xxx", 1234);
s << "RUN"
s.close()
I also tried it this way:
s = new Socket(new Inet4Address("xx.x.xx.xxx"), 1234);
s << "RUN"
s.close()
I get always a connection refused exception:
Caught: java.net.ConnectException: Connection refused: connect at web3.run(web3.groovy:1)
I know, this piece of code does not really make sense, but it is all I need.
Thanks for your help.