Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 1.11 KB

Connection.md

File metadata and controls

26 lines (18 loc) · 1.11 KB

Connection objects

Connection to the q process is wrapped by the instances of classes implementing the QConnection interface.

The qSharp library provides two implementations of the QConnection interface:

  • QBasicConnection - basic connector implementation,
  • QCallbackConnection - in addition to QBasicConnection enables the Event mechanism to publish messages received from q.

The QBasicConnection class provides following constructor:

QBasicConnection(String host, int port, String username, String password, String encoding)

The QCallbackConnection class provides equivalent constructor:

QCallbackConnection(String host, int port, String username, String password, String encoding)

Managing the remote connection

Note that the connection is not established when the connector instance is created. The connection is initialized explicitly by calling the Open() method.

In order to terminate the remote connection, one has to invoke the Close() method.

The QConnection interface provides the Reset() method which terminates current connection and opens a new one.