Thanks for your answer.

1) My question is how to detect my write() is failed. MINA has this
function?
2) Can you kindly show me how you generate your session ID? Right now i use
session.hashcode, do you think it is good?
3) I am just newbie about the newworking programming. So can you point out
the way to measure CPU time for  the I/O wait? What you said if my server
side bandwidth is small, the situation I discribe could happen?
4) How can I prevent the client open millions of socket connection to my
server and try to crash my server?
Thanks again.


2007/2/23, Vinod Panicker <[EMAIL PROTECTED]>:

On 2/21/07, mat <[EMAIL PROTECTED]> wrote:
> Thanks. Please see *** for reply
>
> 2007/2/20, Trustin Lee <[EMAIL PROTECTED]>:
> >
> > 2007-02-20 (화), 02:13 +0800, haiyun wang 쓰시길:
> > > Hi all,
> > >
> > > I currently use mina as the Gateway and something works fine.
However, I
> > > found out a problem.
> > > 1) When the client unpluged the cable, how the server knows? I think
> > server
> > > can't detect it. But how to find out the send message fail on
certain
> > > sesssion.
> >
> > The bottom line is that server doesn't know and you get to know that
> > when you write something.  Please refer to this thread:
> >
> > http://tinyurl.com/2wzznb
>
>
> *** Can you kindly point out how to detect write something on session
> failing? I couldn't make it work. Thanks.

Pls clarify.

> > 2) BTW, which value should I use as a socket session ID? Currently i
use
> > > sessionIO.hashcode. Any better idea?
> >
> > System.identityHashCode() might be better for you in this case.
>
>
> ***http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4990451  I don't
quite
> understand this.But the session ID is the most common requirement for
every
> socket server. Normally how people deal with this?

You can create your own session id if u want. I'm doing that.

> > 3) If I send the 10000 message to one of the session at the same time,
> > would
> > > that block the message deliever to the other sessions?
> >
> > If your network is fast enough, it might.  But it won't in most cases.
>
>
> ***I may not explain my question clearly. My question is: my server
keeps
> sending the real data to end users(1000 let's say). However, some of the
end
> user may query something at the same time which causes my server will
send
> back over 10000 messages once to the session who queried. I wonder if
the
> size of message is too big and that the real data is queued and can't be
> sent at the same time?

This would depend on factors that you haven't told us about.
What is the network bandwidth?
What is the size of the messages?
What is the hardware configuration? CPU utilization when something
like this happens?

The design of your application will determine whether something like
what you need is possible or not.

To determine whether the application is getting stuck due to network
latency or I/O issues, check the time that the CPU is spending in I/O
wait mode.  If it is a significant amount, then the problem is that
your network is too slow to transport the data being generated by the
server.

HTH,
Vinod.

Reply via email to