Main Content

close

Close Bloomberg Server connection V3

Since R2021a

Syntax

Description

example

close(c) closes the Bloomberg® Server connection V3 c using the Bloomberg Server C++ interface.

Examples

collapse all

First, create a Bloomberg Server 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.

Connect to the Bloomberg Server using the IP address of the machine running the Bloomberg Server. This example uses the Bloomberg Server C++ interface and assumes the following:

  • The Bloomberg UUID is 12345678.

  • The IP address for the machine running the Bloomberg Server is '111.11.11.111'.

c is a bloombergServer object.

uuid = 12345678;
ipaddress = '111.11.11.111';

c = bloombergServer(uuid,ipaddress);

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 Server connection, specified as a bloombergServer object.

Version History

Introduced in R2021a