T_ASC_Network net

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
markw
Posts: 84
Joined: Mon, 2005-01-17, 01:08

T_ASC_Network net

#1 Post by markw »

Hi,

In my application, I have a two buttons:

1) Echo address 1
2) Echo address 2

Each button function creates a local T_ASC_Network object. Should there only ever be one global T_ASC_Network variable? Is it not legal to create a new instance locally within a function? I get some errors when trying this.

Thanks

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1446
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

If I remember correctly (and this part of the code dates back to ca. 1993), a T_ASC_Network structure encapsulates a listen socket. So for each listen socket you will need on instance of that structure. If you are an association initiator (requestor) there is no need for multiple T_ASC_Network objects. You have to keep in mind however, that calling the "constructor" for T_ASC_Network will initialize some global data structures and is not protected for use in a multithread environment (the whole network module is not MT-safe). In particular the DUL finite state machine (state table) will be rebuilt. If another thread happens to access that table at the same time, strange things are likely to happen. Ideally you should create all your T_ASC_Network objects at application start, and then just leave them as they are.

markw
Posts: 84
Joined: Mon, 2005-01-17, 01:08

#3 Post by markw »

Ok I'll have to look through the code some more to make sure what I'm doing is safe.

In another post, I think you or another member of the dcmtk team had said the code I was talking about dated back to '93 so is a little out of memory - I am just wondering if I'm using the most up to date code (v3.5.4). Is it just that you guys don't mess around with the core code any more, or am I just using something that's really out of date? Just want to make sure I'm on the same page as everyone else!

Thanks,
Mark

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1446
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#4 Post by Marco Eichelberg »

3.5.4 is still the latest release (save for CVS snapshots). We're planning a new in a couple of months, but there won't be too much new functionality, rather the usual set of bug fixes. So far, the changes really did not justify the effort for putting together and testing a new release on all supported platforms.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest