简体   繁体   English

无法建立与从ant启动的应用程序的tcp连接

[英]Cannot establish tcp connection to application launched from ant

I implemented a simple TCP Echo server in java. 我用Java实现了一个简单的TCP Echo服务器。 It works fine if I launch it from the command line. 如果我从命令行启动它,它将正常工作。

But it doesn't work if I launch it from ant. 但是,如果我从ant启动它,它将不起作用。 I tried both 'java' and 'exec' tasks. 我尝试了“ java”和“ exec”任务。 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. 但是远程客户端无法连接到我的TCP服务器。

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. 启动一个shell,在Windows上使用netstat -ano,在Unix或Mac上使用netstat -anp。
  2. Check that your firewall allows remote connection to the port you are listening on 检查防火墙是否允许远程连接到您正在监听的端口

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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