主要内容

连接至彭博

This example shows how to create a connection to Bloomberg®使用这些彭博服务:彭博桌面,彭博服务器和B-Pipe®。有关彭博连接要求的详细信息,请参阅数据服务器连接要求。为了确保成功的彭博连连接,请在执行连接函数之前执行所需的步骤。有关详细信息,请参阅安装彭博和配置连接

创建彭博桌面连接

C = BLP
c =带有属性的blp:session:[1x1 com.bloomberglp.blpapi.session] ipaddress:'localhost'端口:8194超时:0

blpCreates a Bloomberg connection objectC并返回其属性。

验证连接C

v = isConnection(c)
v = 1

v返回真正的表明彭博连接有效。

检索彭博桌面连接属性。

v =得到(c)
v = session:[1x1 com.bloomberglp.blpapi.session] ipaddress:'localhost'端口:8194超时:0

v是包含彭博会话对象,IP地址,端口号和超时值的结构。

关闭彭博桌面连接。

关闭(c)

创建彭博服务器连接

使用运行彭博服务器的机器的IP地址连接到彭博服务器。该代码假定以下内容:

  • 彭博社是12345678

  • IP地址Serverip对于运行彭博服务器的机器是'111.11.11.111'

uuid = 12345678;serverip ='111.11.11.111';c = blpsrv(uuid,serverip)
C =带有属性的BlPSRV:UUID:12345678用户:[1x1 com.bloomberglp.blpapi.impl.at] session:[1x1 com.bloomberglp.blpapi.session.session.session.session] ipaddress] ipaddress:'111.11.11.11.11.111'port:8195 port:8195超时:8195超时:8195超时:8195超时:

blpsrvConnects to the machine running the Bloomberg Server on the default port number8195blpsrv创建彭博服务器连接对象C

关闭Bloomberg服务器连接。

关闭(c)

创建B-Pipe联系

使用运行Bloomberg B-Pipe进程的机器的IP地址创建彭博B-Pipe连接。该代码假定以下内容:

  • 身份验证是Windows®通过设置进行身份验证授权类型'os_logon'

  • 应用程序名称为空白,因为您没有使用应用程序连接到彭博b-pipe。

  • IP地址Serverip对于运行彭博b-pipe过程的机器是'111.11.11.112'

  • 端口号是8194

授权类型='os_logon';ApplicationName ='';serverip = {'111.11.11.112'};portnumber = 8194;c = bpipe(授权类型,applicationname,serverip,portnumber)
C =带有属性的bpipe:appauthtype:''authtype:'os_logon'appName:[]用户:[1x1 com.bloomberglp.blpapi.impl.at] session:[1x1 com.bloomberglp.blpapi.session.sessession ipaddress] ipaddress] ipaddress:.11.112'}端口:8194.00超时:0

bpipe在端口号上连接到彭博b-pipe8194bpipe创建彭博b-pipe连接对象C

关闭B-Pipe连接。

关闭(c)

也可以看看

|||||

相关示例

更多关于