koush / AndroidAsync

Asynchronous socket, http(s) (client+server) and websocket library for android. Based on nio, not threads.
Other
7.51k stars 1.56k forks source link

mDataHandler failed to consume data #708

Open xmuSistone opened 2 years ago

xmuSistone commented 2 years ago

Hello,

i got this error: java.lang.RuntimeException: mDataHandler failed to consume data, yet remains the mDataHandler. at com.koushikdutta.async.Util.emitAllData(Util.java:39) at com.koushikdutta.async.AsyncNetworkSocket.onReadable(AsyncNetworkSocket.java:160) at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:878) at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:726) at com.koushikdutta.async.AsyncServer.access$800(AsyncServer.java:46) at com.koushikdutta.async.AsyncServer$8.run(AsyncServer.java:680)

in my case, i called setMultipartCallback : MultipartFormDataBody body = (MultipartFormDataBody) request.getBody(); body.setMultipartCallback(part -> { DataHolder dataHolder = new DataHolder(part.getName()); body.setDataCallback(dataHolder); });

after data arrived and completed, i called this: response.send("application/json; charset=utf-8", result); //AsyncHttpServerResponse

can you please figure out what my mistake is?

elite-mob commented 11 months ago

bug

Not everytime, but it's happening to me as well sometimes and it's crashing the application...