I have been working on socket programming, i create a port for example :8080 and i try to send data by device's ip address with socket from one device to another but the problem is when devices get disconnected from access point (my wifi modem) they change their ip addresses on reconnecting and as i saved the old ip address socket doesn't work and i can't send any data.
is there any way to disable this ip changing and give one ip to one device all the time when it gets connected to the same access point ?
am i doing it completely wrong and shouldn't save the ip address ?