A recent Mina-based application, managed with HTTP services, is also implemented by the HTTP service Mina, and the runtime discovers that if the data returned by HTTP is greater than
98304, the client will receive not completely toss for 2 days, only to find that Mina each send the message size is 98304, I did not find the method of sending multiple times, and not sure how many times sent will not be received by the client, finally reference some information, to find ways to modify the size, The first thing you need to know is the total size of the data you want to send, and the way I implement it is to add a total size httpresponsemessage inside the Httpresponseencoder (Messageencoder) inside the Encode room method inside the Buf.flip modified to:
Msg.settotal (Buf.position ());//sets the total size of the actual data size
Buf.flip (). Shrink ();
Then send the modification where the data is sent:
int s = Session.getconfig (). Getmaxreadbuffersize (); Writefuture WF;WF = session.write (response);//must call this first, encoder will be called before it can be set to the total size, the following can be taken to int t = response.gettotal (); if (t >s*1.5) {//Send buffer size is 1.5 times times the read buffer int new_s = (int) (Math.ceil (t/1.5) +), Session.getconfig (). Setmaxreadbuffersize (New_ s);//set to large enough}wf.setwritten (); wf.awaituninterruptibly (); if (!wf.isdone ()) {System.out.printf ("not send------------- ------------------------------\ n ");}
Always think my method is very earth, but it works, seek master
My group, group name is: phper& page Tour &mobile&u3d 2D
Group number: 95303036
Dabigatran in addition to asking questions, please remember to help others, thank you.
----------------------------------to send an advertisement again. Click the map to enter, support my friend.
Group name is: phper& page Tour &mobile&u3d 2D
Group number: 95303036
Dabigatran in addition to asking questions, please remember to help others, thank you.
----------------------------------again send an advertisement, buy furniture on the net cheap 1/4, also parcel mail. Point chart into, support my wife.
Apache Mina output message size modified to address the limit of 98304 maximum data received by the HTTP service client