ASPEN_OpenSession

 

Related Topics

 

 

Purpose

Attempt to open a communication session with an Aspen Server.

 

 

Call Syntax

#include <aspen.h>

AspenRequest(GLOBAL_session, ASPEN_OpenSession, &serverAddress,

&session);

 

 

Parameters

Input

The input parameter for this service is a pointer to an ASPEN_ADDRESS structure that identifies the Aspen Server with which you are attempting to establish a session.

 

Output

A pointer to an int that receives a unique number to identify the new session in any subsequent service requests.

 

 

Structures

typedef struct ASPEN_address_struct

{

   unsigned short  family;

   unsigned short  proc_addr;

   unsigned char   address[16];

}ASPEN_ADDRESS;

 

 

Remarks

ASPEN_OpenSession establishes communication between the client application and an Aspen Server; however, an open session is not a validated session. Before a client application can request financial market information, the session must be validated. Call AspenRequest() with ASPEN_ValidateSession to validate an open session.

 

 

Return Value

ASPEN_OK

Session was opened successfully.

ASPEN_RC_CONNECTION_UNSUCCESSFUL

Session could not be opened.

ASPEN_RC_CHANNEL_UNAVAILABLE

Requested network channel is unavailable.

ASPEN_RC_TRANSPORT_UNAVAILABLE

Requested network transport protocol is unavailable.

 

 

See Also

ASPEN_CloseSession

ASPEN_ValidateSession

AspenRequest()

ASPEN_ADDRESS

 

 

Example

int CAspenRequestDlg::DoASPEN_OpenSession()

{

   ASPEN_ADDRESS     serverAddress;

   char              IPaddress[20];

   server_list       *slp = list;

   int               retval;

 

   // Connect to Server

   strcpy(IPaddress, svServerAddr);

   retval = AspenBuildServerAddress(ASPEN_INET, IPaddress, &serverAddress);

   if (retval == ASPEN_OK)

   {

      retval = AspenRequest(0, ASPEN_OpenSession, (void *)&serverAddress, &slp->server_session);  

   }

   return retval;

}

 

©2006 Aspen Research Group, Ltd. All rights reserved. Terms of Use.