Le 12/11/13 9:32 AM, 郭志勇 a écrit :
> hi All:
> 1, I use the mina 2.0.7
> 2, my partly code as follows:
>
>
> public void sessionCreated(IoSession session) throws Exception {
> long num = count.getAndIncrement() + 1;
> log("sessionCreated,创建session,现在有" + num + "个sessio连接,
> session=" + session );
> }
>
>
> public void sessionClosed(IoSession session) throws Exception {
> long num = count.getAndDecrement() - 1;
> FCJedis fcJedis = fcJedisUtils.getJedis();
> CallRecordJedis crJedis = crJedisUtils.getJedis();
> UAJedis uaJedis = uaJedisUtils.getJedis();
> try {
> //减少session的统计数量,这个必须放在这里先执行,不然如果下面语句执行出现了异常,则数量就减不下来
>
> Object obj = session.getAttribute( ATTR_USER_ID );
> String user = ( obj == null ? null : obj.toString() );
> log("sessionClosed,关闭session,现在有" + num + "个sessio连接,
> userId=" + user + ",session=" + session );
>
>
> }
>
>
> it print the session num when it is create and closed,
> but recently,one exception often happen, the exception as follows:
Sorry, but I don't see any exception. Ther is just a ERROR log, but it
seems that your log wrapper is doing something wrong here, as all the
following mesages are generated with an ERROR.
Regarding the continuous creation of sessiosn, you can see that the IP
address differs for each of those sessions. Check on the client side.
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com