Hi there,

Just wondering, wouldn't that be more suitable for a codec implementation?

Suf
----- Original Message ----- From: "Niklas Therning" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, June 01, 2006 9:12 PM
Subject: Re: NIO channel "commands" or something mad like that....


It seems like a great idea! Though, just like you say, there would probably be some issues which we need to sort out. Add it to JIRA.

BTW, have you had a look at the StreamWriteFilter? It doesn't do exactly what you want but it could be helpful if you want to write the contents of a file.

/Niklas

Irving, Dave wrote:
Hi,

Just brainstorming really, but here's the deal...
Suppose I want to transfer the contents of a file through mina.
Right now, I have to do this directly by reading in the file and writing
it out through the session.
However, what would be nice would be if I could make use of
FileChannel#transferTo(WritableByteChannel,...).

How cool would that be?

But, of course, there are write ordering issues and such like. So even
if I could grab hold of the channel somehow, I couldn't just transfer to
it - as mina might already be doing some queued writes.

So Im thinking maybe something like a channel "command" or something?

session.perform(SomeKindOfChannelCommand);

Mina queues it, just like a write, and then invokes it when its time
comes.
Obviously a lot more thought would be needed on this (e.g. what
"SomeKindOfchannelCommand" actually looks like, what the invocation
semantics are - blocking / non blocking etc).

Any thoughts? Is this just a stupid idea....?

Dave

Reply via email to