Creating an Engine Client in .NET

This section provides a code example for creating an engine client in .NET.

First, create an instance of a client to connect to and communicate with an instance of Sybase CEP Server, as part of the constructor:

engineClient = SDK.EngineClientFactory.NewEngineClient(
   serverUrl, CredentialsFactory.NewCredentials(
   userName, password));

This line creates a new engine client to run operations on a particular Sybase CEP Server process. The NewEngineClient method takes parameters specifying the HTTP URL of the host running Sybase CEP Server (such as http://mymachine.mycompany.com:6789 ) and the authentication credentials to use when connecting with a server that requires authentication. The example defaults to a server process on the local host with no authentication required. When you run any of the .NET3 examples, all of which contain this code, you can pass a server URL, account name, and password on the command line to override the default behavior, if needed for your environment.