세션 통합자에 대한 LU0 세션에 연결할 때 수행해야 하는 첫 번째 작업은 개체를 만들고 초기화하는 Microsoft.HostIntegration.SNA.Session.SessionLU0 것입니다. 이름에서 알 수 Microsoft.HostIntegration.SNA.Session.SessionLU0 있듯이 애플리케이션에 대한 LU0 세션을 나타내며 SNA 네트워크에 액세스하는 데 사용할 기본 인터페이스입니다.
연결을 초기화한 후 LU0 세션을 통해 정보를 보내고 받을 수 있습니다.
LU0에 대한 세션 통합기 세션 초기화
연결할 세션 유형을 결정합니다.
필요한 경우 .를 사용하여
Microsoft.HostIntegration.SNA.Session.SessionConnectionLU0새 세션 연결을 만듭니다.관련 정보가 모두 있는 경우
Microsoft.HostIntegration.SNA.Session.SessionConnectionLU0를 직접 생성할 수 있습니다. 그러나 이 단계를 수행할 필요는 없습니다. 3단계에서 LU 연결 문자열만 전달할 가능성이 높습니다.를 사용하여
Microsoft.HostIntegration.SNA.Session.SessionLU0새 세션을 만듭니다.연결 정보를
Microsoft.HostIntegration.SNA.Session.SessionLU0.Connect%2A에 전달합니다.Connect에는 여러 오버로드가 포함됩니다. 이미 만든Microsoft.HostIntegration.SNA.Session.SessionConnection개체,Microsoft.HostIntegration.SNA.Session.SessionConnection개체 및 추가 초기화 정보 또는 연결 문자열 및 초기화 정보를 사용하여 연결하도록 선택할 수 있습니다.연결 문자열을 사용하여 호출
Microsoft.HostIntegration.SNA.Session.SessionLU0.Connect%2A하도록 선택하면 세션 통합자가 새Microsoft.HostIntegration.SNA.Session.SessionConnectionLU0항목을 만듭니다.Microsoft.HostIntegration.SNA.Session.SessionLU0.Connection%2A을 통해Microsoft.HostIntegration.SNA.Session.SessionConnectionLU0개체에 직접 액세스할 수 있습니다.필요한 경우,
Microsoft.HostIntegration.SNA.Session.SessionLU0.IsConnected%2A을(를) 사용하여 연결되었는지 확인하세요.
예시
다음 코드 예제에서는 사용자로부터 받은 연결 문자열을 사용하여 세션을 만드는 방법을 보여 줍니다.
private void CreateSession_Click(object sender, EventArgs e)
{
try
{
LUName.Text = LUName.Text.Trim();
if (LUName.Text.Length == 0)
{
MessageBox.Show("You must fill out the LU or Pool Name");
return;
}
_session = new SessionLU0(); _session.Connect("LogicalUnitName=" + LUName.Text, SessionLU0InitType.SSCP);
// Receive the logon screen.
SessionLU0Data receivedData = _session.Receive(20000, true);
// Trace out the received data.
TraceData(false, receivedData.Data, receivedData.Indication);
// Disable every button and text box.
DisableEverything();
// Insert User/Password.
EnableInsertUserId();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
이 코드 예제의 주요 목적은 새 세션을 만들고 연결 문자열을 사용하여 LU에 연결하는 것입니다. 그러나 이 예제는 LU0 세션을 통해 데이터를 다시 받습니다. 이 예제에서는 함수를 사용하여 암호 정보도 보냅니다 EnableInsertUserId .
또한 참조하십시오
LU0용 트랜잭션 통합자를 사용하여 메시지 보내기
LU0용 세션 통합자
LU0 코드에 대한 세션 통합자 예제
IcomLU0 인터페이스