mina-ftpserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sai Pullabhotla <sai.pullabho...@jmethods.com>
Subject Re: Getting Host IP address from Ftplet
Date Thu, 03 Jun 2010 10:15:02 GMT
First of all, FTP server will not bind on all available IP addresses
all the time. It does so if you omit the local address on the
listener. You can set the server to listen on what ever IP address you
want it to listen on, and add a listener for each IP and port
combination. Please take a look at the documentation for more
information on this.

http://mina.apache.org/ftpserver/listeners.html

Now the answer to your question is -

Yes, it is possible. Simply call -
session.getServerAddress().getAddress() from the Ftplet methods. This
will give you the InetAddress object (which is IP address) to which
the client connected. You can also get the port number
session.getServerAddress().getPort() to which the client connected.

Hope this helps.

Sai

On Thu, Jun 3, 2010 at 4:53 AM, Aidan Diffey
<aidan.diffey@googlemail.com> wrote:
> Hello all.
>
> I have one embedded FTP server running on a machine with multiple virtual IP
> addresses. I have an FTP client that can send messages to any of the virtual
> IP addresses.
>
> I understand from the documentation that the FTP server will bind on all
> available IP addresses, but is there a way in the Ftplet to get the IP
> address the message was received on?
>
> Kind Regards
>

Mime
View raw message