comparison core/src/luan/modules/IoLuan.java @ 611:8bd98da6991a 0.14

remove pickle code
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 11 Dec 2015 12:24:24 -0700
parents b4f3dbe1c6e3
children cdc70de628b5
comparison
equal deleted inserted replaced
610:b4f3dbe1c6e3 611:8bd98da6991a
645 } 645 }
646 646
647 @Override public String to_string() { 647 @Override public String to_string() {
648 return socket.toString(); 648 return socket.toString();
649 } 649 }
650
651 public LuanTable pickle_client(LuanState luan) throws IOException {
652 InputStream in = new BufferedInputStream(inputStream());
653 OutputStream out = new BufferedOutputStream(outputStream());
654 return new PickleClient(luan,in,out).table();
655 }
656
657 public void run_pickle_server(LuanState luan) throws IOException, LuanException {
658 InputStream in = new BufferedInputStream(inputStream());
659 OutputStream out = new BufferedOutputStream(outputStream());
660 new PickleServer(luan,in,out).run();
661 }
662
663 @Override public LuanTable table() {
664 LuanTable tbl = super.table();
665 try {
666 tbl.rawPut( "pickle_client", new LuanJavaFunction(
667 LuanSocket.class.getMethod( "pickle_client", LuanState.class ), this
668 ) );
669 tbl.rawPut( "run_pickle_server", new LuanJavaFunction(
670 LuanSocket.class.getMethod( "run_pickle_server", LuanState.class ), this
671 ) );
672 } catch(NoSuchMethodException e) {
673 throw new RuntimeException(e);
674 }
675 return tbl;
676 }
677 } 650 }
678 651
679 public static LuanTable socket(LuanState luan,String name) throws LuanException, IOException { 652 public static LuanTable socket(LuanState luan,String name) throws LuanException, IOException {
680 int i = name.indexOf(':'); 653 int i = name.indexOf(':');
681 if( i == -1 ) 654 if( i == -1 )