简体   繁体   中英

Cannot establish tcp connection to application launched from ant

I implemented a simple TCP Echo server in java. It works fine if I launch it from the command line.

But it doesn't work if I launch it from ant. I tried both 'java' and 'exec' tasks. The process is started correctly but the clients cannot connect to it.

Actually, local clients can establish the connection. But remote clients cannot connect to my TCP server.

Does the ant put some restrictions (sandbox?) on applications launched from it?

  1. Check that you are listening on the correct address. Start a shell and use netstat -ano on Windows and netstat -anp on Unix or Mac.
  2. Check that your firewall allows remote connection to the port you are listening on

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM