comparison core/src/luan/modules/IoLuan.java @ 701:d0280c7fdc3a

add Io.ip()
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 04 May 2016 17:49:41 -0600
parents ca169567ce07
children 52ecb629a634
comparison
equal deleted inserted replaced
700:61b36d5895df 701:d0280c7fdc3a
22 import java.io.IOException; 22 import java.io.IOException;
23 import java.io.FileNotFoundException; 23 import java.io.FileNotFoundException;
24 import java.net.URL; 24 import java.net.URL;
25 import java.net.Socket; 25 import java.net.Socket;
26 import java.net.ServerSocket; 26 import java.net.ServerSocket;
27 import java.net.InetAddress;
27 import java.net.MalformedURLException; 28 import java.net.MalformedURLException;
29 import java.net.UnknownHostException;
28 import java.util.List; 30 import java.util.List;
29 import java.util.ArrayList; 31 import java.util.ArrayList;
30 import luan.Luan; 32 import luan.Luan;
31 import luan.LuanState; 33 import luan.LuanState;
32 import luan.LuanTable; 34 import luan.LuanTable;
671 } 673 }
672 }; 674 };
673 } 675 }
674 676
675 677
678 public static String ip(String domain) {
679 try {
680 return InetAddress.getByName(domain).getHostAddress();
681 } catch(UnknownHostException e) {
682 return null;
683 }
684 }
685
686
676 // security 687 // security
677 688
678 public interface Security { 689 public interface Security {
679 public void check(LuanState luan,String name) throws LuanException; 690 public void check(LuanState luan,String name) throws LuanException;
680 } 691 }