|
|
|||||
|
The OPEN_SESSION function opens a network session with a NET SatisFAXtion server or CAS component on the server. Before a session can be opened, a CAS instance must be opened with the CAS Open method, and the instance must be logged on to the connection router in a domain with the LOGON function. Once an instance has logged on to the connection router, sessions can be opened with CAS server components in the logged on domain, as specified by a REMOTE_LOGON_NAME. A CAS instance can only have one session open at a time. Once a session is open, multiple function requests can be made over the session using the CAS Send method. To avoid tying up server resources, an open session should be closed with the CLOSE_SESSION function as soon as it is no longer needed. |
|||||
|
XML Interface: |
|||||
| This tag is not used in the CAS XML
Interface. For more information, see
CAS XML Communications
in the CAS XML Interface. |
|||||
| Type | Max Size | Multiple Allowed | |||
| Function | N/A | No | |||
Example: |
|||||
|
function
LogOnAndOpenSession() { var CAS_instance; // Logon to the connection router if (CAS_instance = CAS.Open(6,"",1000000)) { var Tl, UniqueName, StatusNum; Tl = CAS.New(); CAS.AddTag(Tl,"LOGON",""); UniqueName = "XYZ-"+ parseInt(Math.random()*1000000+1000000); CAS.AddTag(Tl,"LOGON_NAME",UniqueName); CAS.AddTag(Tl,"DOMAIN_NAME","\\\\CASDEV\\NETSATISFAXTION"); CAS.AddTag(Tl,"PROTOCOL",2); // IP Tl = CAS.Send(CAS_instance,Tl); StatusNum = parseInt(CAS.GetTag(Tl,"STATUS_NUM",0)); CAS.Delete(Tl); if (StatusNum == 0) { // Open a session with the server. We can open // sessions multiple times now that we're logged // on to the connection router, but only one session // can be open at a time. Tl = CAS.New(); CAS.AddTag(Tl,"OPEN_SESSION",""); CAS.AddTag(Tl,"REMOTE_LOGON_NAME","NETSATISFAXTION"); Tl = CAS.Send(CAS_instance,Tl); StatusNum = parseInt(CAS.GetTag(Tl,"STATUS_NUM",0)); CAS.Delete(Tl); if (StatusNum == 0) { // We could now send function requests to the server // on the open session, but we'll just close it now // for this example. Tl = CAS.New(); CAS.AddTag(Tl,"CLOSE_SESSION",""); Tl = CAS.Send(CAS_instance,Tl); CAS.Delete(Tl); } Tl = CAS.New(); CAS.AddTag(Tl,"LOGOFF",""); Tl = CAS.Send(CAS_instance,Tl); CAS.Delete(Tl); } CAS.Close(CAS_instance); } } |
|||||
See Also: |
|||||
| LOGON, REMOTE_LOGON_NAME, CLOSE_SESSION, LOGOFF, CAS Open, CAS Send, CAS Close | |||||
|
|