Main Content


Close Bloomberg Server connection V3

Since R2021a




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


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 ''.

c is a bloombergServer object.

uuid = 12345678;
ipaddress = '';

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.


Input Arguments

collapse all

Bloomberg Server connection, specified as a bloombergServer object.

Version History

Introduced in R2021a