Hi Ming Qin,
the second one
> public GrizzlyFuture<WriteResult> write(Object address, Object
> message,
> CompletionHandler<WriteResult> completionHandler) throws
> IOException {
has address parameter, TCP transport ignores it, but it could be
useful for UDP transport, when you use unbound UDP connection.
WBR,
Alexey.
On Mar 12, 2010, at 11:43 , ming qin wrote:
>
> Hi:
> FilterChainContext has two write method be overloaded - see below .
>
> public GrizzlyFuture<WriteResult> write(Object message,
> CompletionHandler completionHandler) throws IOException {
> return write(null, message, completionHandler);
> }
>
> public GrizzlyFuture<WriteResult> write(Object address, Object
> message,
> CompletionHandler<WriteResult> completionHandler) throws
> IOException {
> final FutureImpl futureImpl = FutureImpl.create();
> final FilterChainContext newContext = (FilterChainContext)
> getProcessor().context();
> newContext.setIoEvent(IOEvent.WRITE);
> newContext.setConnection(getConnection());
> newContext.setMessage(message);
> newContext.setAddress(address);
> newContext.setCompletionFuture(futureImpl);
> newContext.setCompletionHandler(completionHandler);
> newContext.setStartIdx(filterIdx - 1);
> newContext.setFilterIdx(filterIdx - 1);
>
> getFilterChain().execute(newContext);
> return futureImpl;
> }
>
>
> How to decide when to use which write method?
>
>
> Ming Qin
> Cell Phone 858-353-2839