Constructor that connects to the server, fails if cannot connect successfully. Connection and login is carried out asynchronously.

Namespace:  T4.API
Assembly:  T4API.20 (in T4API.20.dll)

Syntax

C#
public Host(
	string psServerURL,
	APIServerType penServer,
	string psAppName,
	string psAppLicense,
	string psFirm,
	string psUsername,
	string psPassword
)
Visual Basic (Declaration)
Public Sub New ( _
	psServerURL As String, _
	penServer As APIServerType, _
	psAppName As String, _
	psAppLicense As String, _
	psFirm As String, _
	psUsername As String, _
	psPassword As String _
)
Visual C++
public:
Host(
	String^ psServerURL, 
	APIServerType penServer, 
	String^ psAppName, 
	String^ psAppLicense, 
	String^ psFirm, 
	String^ psUsername, 
	String^ psPassword
)

Parameters

psServerURL
Type: System..::.String
The website for the system, this is used by the API to obtain details of servers that are available for it to connect to. Note: This value is no longer needed and you should provide empty string here. ServerURL is the url to the website for the system and not to an individual application server. The API obtains a list of available application servers from the website which it then uses to select an application server to connect to. For Simulator this should be set to 'http://server.sim.t4login.com' and for Live it should be set to 'http://server.t4login.com'.
penServer
Type: T4..::.APIServerType
Whether the API should connect to the live or simulator system. Either APIServerType.Simulator or APIServerType.Live
psAppName
Type: System..::.String
The name of the application as stated when requesting an application license code. T4Example is a valid application on the simulator system only.
psAppLicense
Type: System..::.String
The license code for the application. 112A04B0-5AAF-42F4-994E-FA7CB959C60B is the license for T4Example on the simulator system. NOTE that license codes will be different between the live and simulator systems for the same application name.
psFirm
Type: System..::.String
The name of the firm you are logging in as. This is the same as the Firm that you enter to log into the website or trading frontend.
psUsername
Type: System..::.String
The username that you are logging in as. This is the same as the username that you enter to log into the website or trading frontend.
psPassword
Type: System..::.String
The password for the user.

Remarks

Intialises the API and starts attempting to connect to the servers. Once connected it attempts to login with the details provided. The result will be raised via the LoginSuccess or LoginFailure events. If login fails and you want to try again then you need to dispose of this object and create another.

See Also