 | SphinxClientOpenPersistentConnection Method |
Opens a persistent connection to searchd.
Namespace:
SphinxConnector.NativeApi
Assembly:
SphinxConnector (in SphinxConnector.dll) Version: 5.4.1
Syntaxpublic void OpenPersistentConnection()
Public Sub OpenPersistentConnection
ExceptionsException | Condition |
---|
SphinxClientException |
An error occured while opening the connection. See exception message and inner exception
for details.
|
Examplesusing (SphinxClient sphinxClient = new SphinxClient())
{
sphinxClient.OpenPersistentConnection();
sphinxClient.Query("myQuery", "myIndex");
sphinxClient.Query("myOtherQuery", "myIndex");
}
The example above uses the
using keyword to close the connection after the queries are executed.
Alternatively you can call
ClosePersistentConnection or
Dispose yourself.
Note that the SphinxClient object is still usable after calling Dispose(). It will just open
a new (non persistent) connection if another call is made.
See Also