IP Validation before accepting incomming client request | Telit Cinterion IoT Developer Community
November 9, 2015 - 10:59am, 2258 views
Is there any way to validate IP of incoming client request from remote devices before accepting socket request in SocketServer App ?
Known method like below;
System.out.println("wait client connection");
sc = (SocketConnection) scn.acceptAndOpen();
serRemoteIP = sc.getAddress();
System.out.println("TCPserver Remote IP : " +serRemoteIP);
if (serRemoteIP.indexOf("188.51.29.57")> -1){
Hello,
Interesting question. It seems that it's not possible. There's no such method. And you wait for the new connection inside the blocking acceptAndOpen() method which automatically gives you the new connection if there's any incoming one.
But on the other hand it doesn't seem to be a problem - you can write your own security routine as you did above to check the IP and then and either open the streams or close the connection.
Regards,
Bartłomiej