On Thu, Oct 2, 2008 at 7:02 PM, Lorenzo Bolzani <[EMAIL PROTECTED]> wrote: > 2008/10/2 Maarten Bosteels <[EMAIL PROTECTED]>: >> >> Good to hear that you like the tutorial :-) > > Yes, It is clear and complete. > The only problems I found were reading LittleEndian encoded numbers > (because I did not found a BufferAllocator that creates this kind of > Buffers and subclassing existing ones to configure this setting is not > easy, at this time I'm reading byte blocks and switching order "by > hand".
Can't you use the order() method ? http://mina.apache.org/report/trunk/apidocs/org/apache/mina/core/buffer/IoBuffer.html#order(java.nio.ByteOrder) http://java.sun.com/j2se/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#order(java.nio.ByteOrder) Maarten No problem for writing) and the doubt about async writes. The > javadoc clearly states that IOSession is thread-safe but I found no > example (chat, netcat, tennis, etc.) working in this way. Maybe a > "keep-alive" feature could be added to the chat example to show the > right way to do it. I'll try to find some time to provide a little > patch... > >> You don't have to synchronize anything, unless your threads are >> sharing non-MINA data structures of course. >> MINA will add the WriteRequest to the queue and the IoProcessor >> thread(s) will put the message on the wire. > > Ok, I'll try. Thanks for your reply to this simple question. > > Bye > > > Lorenzo >
