Hello,
After further study I think I found a way to disconnect a slow client.
IoSession.getScheduledWritesRequests() should give me the number of pending
messages that were not yet written to the remote peer, so if this number
exceeds a certain threshold I could issue IoSession.close().
As far as controlled incoming message rate is concerned I experimented a
little with IoSession.suspendRead() but I found out it will not do. I mean
the first suspendRead is doing what it says but after the first resumeRead
the incomming messages rate can't be controlled. So, do you think I could
file a RFE on Jira about this issue? Or is there a possible solution with
the current framework?
Regards,
Horia
On 1/28/07, Trustin Lee <[EMAIL PROTECTED]> wrote:
Sorry for getting back to you so late.
On 11/30/06, seven <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I am studying the possibility of migrating a custom blocking network
> java
> server to a mina based NIO one in order to be able to handle more
> clients
> and higher throughput.
> The server in question has the following features:
> - ObjectStream based
We don't use ObjectInput/OutputStream directly, but we use their modified
version which is optimized for non-blocking I/O. Anyway, you can exchange
serialized Java object.
- incoming message rate is controlled
MINA doesn't support it right now, but it can be implemented.
- outgoing message rate is controlled and if the client can't consume
> the outgoing massage rate the client is disconnected
You can calculate it by yourself, and disconnect.
- SSL support
SSL is supported out of the box.
- compression support based on the message size ( if the serialized
> message object size is higher than a certain threshold then the message
> is
> compressed )
Instead, we use JZlib (Java implementation of zlib) to compress the
stream. I never saw the case that compression ratio is poor.)
Can you advise if this is possible? Can mina provide the those features (
> except ObjectStreaming but with serializable objects ) using NIO?
Nothing is impossible, but we need to think a little bit differently
because we're no longer dealing with a stream but with an event.
HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6