java - NIO and Asynchronous IO choice -


i have written server processes requests concurrently using 1 thread per connection socket. in future might grow decided change more scalable long threads quite expensive. have read 3 options - raw nio, nio framework netty, or asynchronous io java se7. have never used either of confused of them use task , how. task quite simple:

there sever accepts connection. when accepts one, should allocate listener incoming requests (right threads work me way). ie. when there connection, new thread not allocated. when formatted request comes, somehow jvm invokes required listener (which associated channel or socket..) , processes request. thread returned pool or sth , listener waiting incoming requests. there might 10k+ listeners. also, server might send message client @ time asynchronously (so needs find connection pool , send message). or multicast message 1k+ clients. server accepts custom protocol, having connection-break features, or message-size functionality bonus.

i have been trying check above mentioned options this, didnt quite 1 best suits needs long have never worked of those. checked netty , seems heavyweight. task easy achieve nio or nio2? or shall use sth mina or netty? if easy avoid programming mistakes, stick raw apis of java nio. if error prone, maybe better work netty?

don't program nio directly; it's lot more subtle first appears.

i don't aio either; threading model confusing.

my recommendation go netty.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -