One of my libraries wraps a DatagramSocket for sending UDP commands. I'm using the library in a project that uses a service. The library object is declared in the "Sub Process_Globals" for the service.
I've found that if I initialise in "Sub Service_Create As Boolean" then everything is OK.
However if I initialise elsewhere in the service code the socket is not initialised the first time I call the DatagramSocket's Send function ie the first Send fails but the second succeeds. The first send also throws an Java error but the app doesn't crash.
Has anybody seen this before? Ideally I would like to solve the issue as I would like to initialise the object when I need it rather than when the service is created.
Could the problem be the definition of the class? public class BridgeWrapper implements BA.CheckForReinitialize
Or the fact that I've declared it as a global?
I've found that if I initialise in "Sub Service_Create As Boolean" then everything is OK.
However if I initialise elsewhere in the service code the socket is not initialised the first time I call the DatagramSocket's Send function ie the first Send fails but the second succeeds. The first send also throws an Java error but the app doesn't crash.
Has anybody seen this before? Ideally I would like to solve the issue as I would like to initialise the object when I need it rather than when the service is created.
Could the problem be the definition of the class? public class BridgeWrapper implements BA.CheckForReinitialize
Or the fact that I've declared it as a global?