Skip to content

Commit

Permalink
[dcmnet] Add support for setting/getting tcp polling interval from DC…
Browse files Browse the repository at this point in the history
…MScu
  • Loading branch information
100029962 committed Apr 17, 2023
1 parent 0ea4d91 commit 109ec54
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
18 changes: 18 additions & 0 deletions dcmnet/include/dcmtk/dcmnet/scu.h
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,15 @@ class DCMTK_DCMNET_EXPORT DcmSCU
*/
void setConnectionTimeout(const Sint32 connectionTimeout);

/** Set the poll interval (short timeout) used when connecting to the SCP.
* While requesting an association, the TCP connection will be checked for successful
* connection with this timeout until the full connection timeout has been reached, or
* until the connection attempt has been cancelled.
* @param pollInterval [in] poll interval in seconds, <= connectionTimeout).
* set to -1 to disable connect cancellation
*/
void setTcpPollInterval(const Sint32 pollInterval);

/** Set an association configuration file and profile to be used
* @param filename [in] File name of the association configuration file
* @param profile [in] Profile inside the association negotiation file
Expand Down Expand Up @@ -786,6 +795,12 @@ class DCMTK_DCMNET_EXPORT DcmSCU
*/
Sint32 getConnectionTimeout() const;

/** Gets the poll interval (short timeout) that defines how frequently the SCU will check
* for cancelled connect attempt.
* @return The poll interval (in seconds)
*/
Sint32 getTcpPollInterval() const;

/** Returns the storage directory used for storing objects received with C-STORE requests
* in the context of C-GET sessions. Default is empty string which refers to the current
* working directory.
Expand Down Expand Up @@ -1099,6 +1114,9 @@ class DCMTK_DCMNET_EXPORT DcmSCU
/// TCP connection timeout (default: value of global dcmConnectionTimeout)
Sint32 m_tcpConnectTimeout;

/// TCP poll interval (default: -1 (disabled))
Sint32 m_tcpPollInterval;

/// Storage directory for objects received with C-STORE due to a running
/// C-GET session. By default, the received objects are stored in the current
/// working directory.
Expand Down
11 changes: 11 additions & 0 deletions dcmnet/libsrc/scu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ DcmSCU::DcmSCU()
, m_dimseTimeout(0)
, m_acseTimeout(30)
, m_tcpConnectTimeout(dcmConnectionTimeout.get())
, m_tcpPollInterval(-1)
, m_storageDir()
, m_storageMode(DCMSCU_STORAGE_DISK)
, m_verbosePCMode(OFFalse)
Expand Down Expand Up @@ -2562,6 +2563,11 @@ void DcmSCU::setConnectionTimeout(const Sint32 connectionTimeout)
m_tcpConnectTimeout = connectionTimeout;
}

void DcmSCU::setTcpPollInterval(const Sint32 pollInterval)
{
m_tcpPollInterval = pollInterval;
}

void DcmSCU::setAssocConfigFileAndProfile(const OFString& filename, const OFString& profile)
{
m_assocConfigFilename = filename;
Expand Down Expand Up @@ -2650,6 +2656,11 @@ Sint32 DcmSCU::getConnectionTimeout() const
return m_tcpConnectTimeout;
}

Sint32 DcmSCU::getTcpPollInterval() const
{
return m_tcpPollInterval;
}

OFString DcmSCU::getStorageDir() const
{
return m_storageDir;
Expand Down

0 comments on commit 109ec54

Please sign in to comment.