更新时间:2021-11-27 08:10:48
当我用下面的code片段通过DefaultHttpServerConnection属性为handle()方法,我没有得到这个异常:
When I passed the DefaultHttpServerConnection attribute to the handle() method using the following code snippet, I did not get this exception:
在的WorkerThread类,使用下面的code传递DefaultHttpServerConnection连接对象:
In the WorkerThread class, pass the DefaultHttpServerConnection connection object using the following code:
HttpContext context = new BasicHttpContext(null);
context.setAttribute("XXX",this.conn);
在手柄()方法,用得到的连接对象,
In the handle() method, get the connection object using,
(DefaultHttpServerConnection)context.getAttribute("XXX");
希望它可以帮助别人!
Hope it helps someone!