Bloomberg Api连接问题 - <localhost:8194>连接失败</localhost:8194>

时间:2014-07-20 01:26:48

标签: c++ blpapi

我正在尝试使用bloomberg c ++ api示例。得到以下错误:

ritesh@Ritesh:~/Desktop/blpapi_cpp_3.7.5.1/Linux$ ./RequestServiceExample_64 
RequestServiceExample
Connecting to port 8194 on localhost 
Server is starting------

20JUL2014_09:18:35.921 7794:139791222232832 ERROR blpapi_platformtransporttcp.cpp:671 blpapi.session.transporttcp.{1}.<localhost:8194> Connection failed 

20JUL2014_09:18:35.921 7794:139791222232832 WARN blpapi_platformcontroller.cpp:371 blpapi.session.platformcontroller.{1} Platform: 0 failed 1 consecutive connect attempts, stopped trying to reconnect. 

Server received an event

20JUL2014_09:18:35.922 7794:139791222241088 ERROR blpapi_providersessionimpl.cpp:640 blpapi.providersession.{1} Failed to start provider session: rc=9 
Failed to start server session.
Client is starting------
SessionStartupFailure = {
    reason = {
        source = "Session"
        category = "IO_ERROR"
        errorCode = 9
        description = "Connection failed"
    }
}

20JUL2014_09:18:35.922 7794:139791141598976 ERROR blpapi_platformtransporttcp.cpp:671 blpapi.session.transporttcp.{2}.<localhost:8194> Connection failed 

20JUL2014_09:18:35.922 7794:139791141598976 WARN blpapi_platformcontroller.cpp:371 blpapi.session.platformcontroller.{2} Platform: 0 failed 1 consecutive connect attempts, stopped trying to reconnect. 
Failed to start client session.
Client received an event
Press ENTER to quit

SessionStartupFailure = {
    reason = {
        source = "Session"
        category = "IO_ERROR"
        errorCode = 9
        description = "Connection failed"
    }
}

ritesh@Ritesh:~/Desktop/blpapi_cpp_3.7.5.1/Linux$ 

有没有人对api有所了解?它尝试连接的连接是什么?我是否需要在端口8194上侦听任何其他服务器?

2 个答案:

答案 0 :(得分:5)

要使用Bloomberg API SDK,您需要Bloomberg数据源,该数据源是Bloomberg订阅产品的一部分。 API SDK使用端口8194上的TCP连接连接到数据馈送端点(如您所见),示例程序假设在&#39; localhost&#39;上有端点。 (因为任何装有Bloomberg Professional终端的机器都有。)

您在Linux计算机上运行此操作,除非您在该计算机上安装了数据Feed设备包,否则您在本地主机上没有API端点。如果网络中有API端点,则需要为示例程序指定正确的命令行参数,以告知其API端点的IP地址(和非默认端口号)。

(另请注意,您尝试运行的特定示例程序是&#39;发布者&#39;,并且需要使用Platform API端点进行连接,它不能与任何其他类型的API端点一起使用)< / p>

答案 1 :(得分:1)

您的日志文件指示错误9,这似乎表明地址已在使用中。运行netstat命令以查看另一个程序是否已使用您绑定到localhost的端口