2009/5/20 Ulysess Lee 李宇光 <[email protected]>:
> I found that in nest version(1.0.0) , I could not use session.write well as 
> before, like that:
> I has a ftplet extends DefaultFtplet ,and in overrided method:beforeCommand I 
> wrote some code to stop some cmds which I would not allow. e.g:
>
> @Override
> public FtpletResult beforeCommand(FtpSession session, FtpRequest request) 
> throws FtpException,
> IOException {
>    String command = request.getCommand();
>    if (command.toUpperCase().equals("PWD")) {
>        session.write(new DefaultFtpReply(202,"Cmd not allowed"));
>    }
>
>    ...
>    {code for write log in db
>    and do some thing here}
>    ...
>
>    return FtpletResult.SKIP;
> }
>
> In {code for write log in db and do some thing here} here I want run some 
> code after session write a 202 message to client, but the truth is 
> session.write 's 202 would hold and wait until method return.
>
> I think, In early version this works fine, session.write() will send to 
> client at first time, is there has some change?

FtpSession.write() is merely a wrapper around MINAs IoSession.write
which is asyncronous. Could you please provide some more details on
what you mean by: "but the truth is session.write 's 202 would hold
and wait until method return".

/niklas

Reply via email to