LDicomNet::Close

#include "ltdic.h"

L_VOID LDicomNet::Close(L_VOID)

Closes the connection between an associated SCU and SCP. This function is available in the Medical Suite Toolkit.

Returns

None.

Comments

Calling this function generates a call to the LDicomNet::OnClose function. The LDicomNet::OnClose function is useful to both SCUs and SCPs.

Calling LDicomNet::Close closes the connection between an associated client and server. The Network connection itself is not shutdown until LDicomNet::ShutDown is called.

Required DLLs and Libraries

LTDIC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

LDicomNet::Accept, LDicomNet::Connect, LDicomNet::OnClose

Topics:

Working with DICOM Network Connections

Example

{
//This function is called by the server to close the connection from the
//    most recently connect client.
//
//LMyDicomNet is a class derived from LDicomNet
//m_pDicomNet is a member variable declared as:
//    LMyDicomNet *m_pDicomNet;
//
//In this example, assume
//1. m_pDicomNet points to a valid object
//2. A connection exists between client and server
//3. An associate request has been sent and accepted

   CString strMsg;
   LDicomNet *pDicomNetClient;
   L_UINT32 lClientCount;
   L_CHAR szClientAddress[100];
   L_UINT lClientPort;
   
   //get the latest client, and close the connection
   lClientCount = m_pDicomNet->GetClientCount();
   
   if (lClientCount > 0)
   {
      pDicomNetClient = m_pDicomNet->GetClient(lClientCount - 1);
      pDicomNetClient->GetPeerInfo(szClientAddress, &lClientPort);
      strMsg.Format("Total Clients[%d]\nClosing Client [%s]", lClientCount, szClientAddress);
      AfxMessageBox(strMsg);
      pDicomNetClient->Close();
   }
   else
   {
      AfxMessageBox("No Active Clients");
   }
}