Main Content

close

Close Bloomberg B-PIPE connection V3

Syntax

Description

example

close(c) closes the Bloomberg® B-PIPE® connection V3 c using the Bloomberg B-PIPE C++ interface.

Examples

collapse all

First, create a Bloomberg B-PIPE connection. Then, request last and open prices for a security and close the connection. The current data you see when running this code can differ from the output data here.

Create a Bloomberg B-PIPE connection using the IP address of the machine running the Bloomberg B-PIPE process. This example uses the Bloomberg B-PIPE C++ interface and assumes the following:

  • The authentication is Windows® authentication when you set authtype to 'OS_LOGON'.

  • The application name is blank because you are not connecting to Bloomberg B-PIPE using an application.

  • The IP address for the machine running the Bloomberg B-PIPE process is '111.11.11.112'.

  • The port number of the machine running the Bloomberg B-PIPE process is 8194.

c is a bloombergBPIPE object.

authtype = 'OS_LOGON';
appname = '';
ipaddress = {'111.11.11.112'};
port = 8194;

c = bloombergBPIPE(authtype,appname,ipaddress,port);

Request last and open prices for Microsoft®.

[d,sec] = getdata(c,'MSFT US Equity',{'LAST_PRICE';'OPEN'})
d = 
    LAST_PRICE: 33.3401
          OPEN: 33.6000

sec = 
    'MSFT US Equity'

getdata returns a structure d with the last and open prices. Also, getdata returns the security in sec.

Close the Bloomberg connection.

close(c)

Input Arguments

collapse all

Bloomberg B-PIPE connection, specified as a bloombergBPIPE object.

Introduced in R2021a