Hello,
I'm using Avro RPC software to send messages, via
SaslSocketServer/Transciever, and the Reflect method.
The problem I found is that I cannot send more than 49149 bytes on a
single RPC call, 1 byte more and the software will lock.
Below, a class I wrote that replicates the issue.
Is it a bug, a limitation, or am I doing something wrong?
Thank you,
Enrico.
public class PoC {
private final static InetSocketAddress addr =
new InetSocketAddress("127.0.0.2", 12345);
public interface ProtoInterface { int test(byte[] b); }
public static void main (String[] args) {
try {
SaslSocketServer s = new SaslSocketServer(
new
ReflectResponder(ProtoInterface.class, new ProtoInterface() {
public int test(byte[] b) {
return b.length; } }), addr);
s.start();
SaslSocketTransceiver client = new
SaslSocketTransceiver(addr);
ProtoInterface proxy = (ProtoInterface)
ReflectRequestor.getClient(
ProtoInterface.class, client);
int res = proxy.test(new byte[49149]);
System.out.println("BYTE ARRAY LENGTH: "+res);
res = proxy.test(new byte[49150]);
System.out.println("NEVER REACH THIS POINT: "+res);
client.close();
try { System.out.print("Shutting down server... ");
s.notify(); }
catch (IllegalMonitorStateException e) { }
}
catch (Exception e) { e.printStackTrace(); }
}
}