thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michi Mutsuzaki <>
Subject java: using binary and TFramedTransport
Date Mon, 25 Apr 2011 20:52:44 GMT

I'm having trouble using binary type with TFramedTransport in Java. I'm
using Thrift 0.6. I have a method that takes a binary as an argument:

    i32 myMethod(1:binary blob),

I have a Java client that calls myMethod():

    TSocket socket = new TSocket("localhost", 9090);
    TTransport transport = new TFramedTransport(socket);;
    TProtocol protocol = new TBinaryProtocol(transport);
    MyService.Client client = new MyService.Client(protocol);

The server is started like this:

    TServerTransport trans = new TServerSocket(port);
    TThreadPoolServer.Args args = new TThreadPoolServer.Args(trans);
    args.processor(new MyService.Processor(new MyProcessor()));
    args.transportFactory(new TFramedTransport.Factory());
    args.protocolFactory(new TBinaryProtocol.Factory(true, true));
    TServer server = new TThreadPoolServer(args);

On the server side, myMethod() receives more than "hello". It looks
something like this:


It works correctly if I don't use TFramedTransport. Am I misusing


View raw message