我有以下简单的代码。它一直工作到三月,但是突然之间我看到它在工作。到达服务器端的请求没有任何内容...从客户端代码中,我可以看到即使是简单的文本也不会运行...我正在使用netty。我的应用程序中的io -all 4.0.10 jar和我的客户端代码如下:
请帮忙
public class HttpClient {
private final URI uri;
private final String ip;
private final int port;
public void run() {
System.out.println("In run method of HttpClient!!!!!!!!!!!!"+uri);
String scheme = uri.getScheme() == null? "http" : uri.getScheme();
String host = uri.getHost() == null? "localhost" : uri.getHost();
System.out.println("--------------------A------------------------------");
if (!"http".equalsIgnoreCase(scheme) ) {
System.err.println("Only HTTP is supported.");
return;
}
System.out.println("---------------------B----------------------------------");
// Configure the client.
EventLoopGroup group = new NioEventLoopGroup();
try {
Bootstrap b = new Bootstrap();
b.group(group)
.channel(NioSocketChannel.class)
.handler(new HttpClientInitializer()); …Run Code Online (Sandbox Code Playgroud) netty ×1