Code: Select all
DcmSCPPool<DicomSCP> pool;
DcmSCPConfig& config = pool.getConfig();
config.setAETitle(lAETitle);
config.setPort(lPort);
config.setConnectionBlockingMode(DUL_NOBLOCK);
// more configs
pool.listen()
Moderator: Moderator Team
Code: Select all
DcmSCPPool<DicomSCP> pool;
DcmSCPConfig& config = pool.getConfig();
config.setAETitle(lAETitle);
config.setPort(lPort);
config.setConnectionBlockingMode(DUL_NOBLOCK);
// more configs
pool.listen()
Great, now, how can I access the config from within my worker?.Jan Schlamelcher wrote:It has been some time since I wrote that code . I think you'll have to get the AE title from the config after it has been initialized instead of in the constructor, i.e. override DcmThreadSCP::setSharedConfig().
Let me try to understand what you mean.Jan Schlamelcher wrote:The DcmThreadSCP::setSharedConfig() method get's it as a parameter?! Make sure to pass it to the base method into your overrided one, so it can be used afterwards using getSharedConfig().
Code: Select all
DcmSCPPool<DicomSCP> pool;
DcmSCPConfig& config = pool.getConfig();
config.setAETitle(lAETitle);
config.setPort(lPort);
config.setConnectionBlockingMode(DUL_NOBLOCK);
// more configs
pool.listen()
Code: Select all
class DicomSCP: public DcmThreadSCP {
public:
DicomSCP();
~DicomSCP();
private:
OFCondition handleIncomingCommand(T_DIMSE_Message *incomingMsg,
const DcmPresentationContextInfo &presContextInfo);
};
Yes, override it in DicomSCP:martinrame wrote:Should I override a setSharedConfig in my class?
Code: Select all
class DicomSCP: public DcmThreadSCP {
public:
DicomSCP();
~DicomSCP();
private:
OFCondition handleIncomingCommand(T_DIMSE_Message *incomingMsg,
const DcmPresentationContextInfo &presContextInfo);
OFCondition setSharedConfig( const DcmSharedSCPConfig& config )
{
// do whatever you need with the config
return DcmThreadSCP::setSharedConfig( config );
}
};
You don't, it always does this:martinrame wrote:how can I tell the pool to pass that config to the worker?.
Code: Select all
201 DcmBaseSCPWorker* const worker = createSCPWorker();
202 if (!worker) /* Oops, we cannot allocate a new worker thread */
203 {
204 result = EC_MemoryExhausted;
205 }
206 else /* Configure worker thread */
207 {
208 m_workersBusy.push_back(worker);
209 worker->setSharedConfig(sharedConfig);
210 chosen = worker;
211 }
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest