We are about to switch to a new forum software. Until then we have removed the registration on this forum.
How do I get the ip adress of a client,
because client.ip()
returns the ip adress of the connected server.
when i create a server event handler,
public void serverEvent(Server server, Client someClient) {
System.out.println("We have a new client: " + someClient.ip());
}
it prints the ip adress of the client, but is it possible
to create something like this on the client side?
Answers
Is there a way, my client programm can do this on it's own?
My server gets the ip adress, I need,
but I don't know how the client can get it's own adress,
he is connected with (not to).
Is there a way to get the socket what is used in the client?
Getting the ip from the internet isn't working, it returns the wrong ip.
I know that the Client class contains a socket,
and when I have a socket, I can access the ip-adress like this:
socket.getLocalAddress().toString().substring(1)
and I know, that you also can construct an instance of Client like this:
but when I use this, my
client
isn't working correctly.It can't recieve data.
Ideas?
Does someone know, why the clientEvent method is not loaded,
when I construct a client with
new Client(ref.app, socket)
https://github.com/processing/processing/blob/master/java/libraries/net/src/processing/net/Client.java
line 93 compared to line 131
Has someone experience with the .net library?
seems you have to change the client Class