Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
0.2
-
None
-
MacOS SnowLeopard
Description
TNonblockingServer exits abnormally when client calls send_xxx function without recv_xxx function.
The following code can reproduce the issue,
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include "aggregator.h"
#include <protocol/TBinaryProtocol.h>
#include <transport/TSocket.h>
#include <transport/TBufferTransports.h>
using namespace apache::thrift;
using namespace apache::thrift::protocol;
using namespace apache::thrift::transport;
//using namespace apache::thrift::concurrency;
using boost::shared_ptr;
int main(int argc, const char *argv[]) {
shared_ptr<TSocket> socket(new TSocket("localhost", 9090));
shared_ptr<TFramedTransport> framedtransport(new TFramedTransport(socket));
shared_ptr<TProtocol> protocol(new TBinaryProtocol(framedtransport));
aggregatorClient client(protocol);
try
{ framedtransport->open(); }catch (TTransportException e)
{ std::cout << "transport exception" << std::endl; return 1; }catch (TException e2)
{ std::cout << "exception" << std::endl; } UserProfile profile;
client.send_retrieve(1);
framedtransport->close();
return 0;
}