Hi all,

I am not sure if this is a bug.
I wrote a PHP standalone server (w/ TSimpleServer) by modifying php
tutorial codes.
The tutorial version of php client could connect to the standalone php
server successfully.
All execution results are correc as expected.
However, c++ client can't even establish the connection.
The error message is listed:

Thrift: Fri Nov 18 04:13:36 2011 TSocket::open() connect() <Host: localhost
Port: 9090>Connection refused
Thrift: Fri Nov 18 04:13:36 2011 TSocket::open() connect() <Host: localhost
Port: 9090>Connection refused
ERROR: connect() failed: Connection refused

Telnet shows port 9090 is available, but c++ client still have problem to
connect.
I also confirmed that c++ server/client works perfectly in the same
environment.
Therefore, I am thinking if the implementation of C and PHP version have
compatibility problem

The main implementation of my php standalone server is listed below.

$handler = new CalculatorHandler();
$processor = new CalculatorProcessor($handler);
$transport = new TServerSocket();
$i_transportFactory = new TTransportFactory();
$o_transportFactory = new TTransportFactory();
$i_protocolFactory = new TBinaryProtocolFactory();
$o_protocolFactory = new TBinaryProtocolFactory();

$simple_server = new TSimpleServer($processor, $transport,
$i_transportFactory, $o_transportFactory, $i_protocolFactory,
$o_protocolFactory);

print "server to start\n";
$simple_server->serve();


Any idea?


Best Regards,

-- 
Keene Tsai (蔡承翰)
http://keene.twbbs.org

Reply via email to