4

我正在尝试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 端口上侦听任何其他服务器?

4

2 回答 2

7

为了使用 Bloomberg API SDK,您需要一个 Bloomberg 数据馈送,它作为 Bloomberg 订阅产品的一部分提供。API SDK 使用端口 8194 上的 TCP 连接(如您所见)连接到数据馈送端点,示例程序假设“localhost”上有一个端点(就像在任何运行 Bloomberg Professional 终端的机器上一样) .

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

(另外,请注意,您尝试运行的特定示例程序是“发布者”,并且需要平台 API 端点进行连接,它不适用于任何其他类型的 API 端点)

于 2014-07-25T14:09:17.637 回答
1

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

于 2014-07-20T01:34:35.573 回答