On 5/6/06, netsql <[EMAIL PROTECTED]> wrote:
I am processing a datainputstream that comes from ip. I used http://svn.apache.org/viewcvs.cgi/directory/trunks/mina/examples/src/main/java/org/apache/mina/examples/httpserver as template to get datastream and get elements out of it. (ex: getSwapedShort()) How do I get the ip address it was sent from?
You can get the IP address of the remote peer by calling IoSession.getRemoteAddress(). Please downcast the returned SocketAddress to InetSocketAddress. ps: How do I make it highly scaelable, DOS compliant? ** To prevent DoS: 1) Disconnect clients which are idle for a long time. 2) Take care of the case that client is too fast or too slow. (We're going to provide an easy way to do this.) HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6
