Mercurial Hosting > luan
diff core/src/luan/modules/RpcLuan.java @ 759:ae612dfc57cb 0.21
better handling of longs in rpc and json
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 19 Jul 2016 09:09:41 -0600 |
parents | c29d11d675fd |
children |
line wrap: on
line diff
--- a/core/src/luan/modules/RpcLuan.java Tue Jul 19 00:57:37 2016 -0600 +++ b/core/src/luan/modules/RpcLuan.java Tue Jul 19 09:09:41 2016 -0600 @@ -32,6 +32,7 @@ private static final int BINARY = 4; private static final int TABLE = 5; private static final int IO = 6; + private static final int LONG = 7; @LuanMethod public static Object[] call(LuanState luan,LuanTable socketTbl,String fnName,Object... args) throws LuanException, IOException @@ -134,6 +135,10 @@ out.write(BOOLEAN); writeBoolean(out,(Boolean)obj); } + else if( obj instanceof Long ) { + out.write(LONG); + writeString(out,obj.toString()); + } else if( obj instanceof Number ) { out.write(NUMBER); writeString(out,obj.toString()); @@ -163,6 +168,8 @@ return readString(in); case BOOLEAN: return readBoolean(in); + case LONG: + return Long.valueOf(readString(in)); case NUMBER: return Double.valueOf(readString(in)); case BINARY: