I'm following the Gurux.DLMS.Meter.Listener.Net example but when I try to start thread with my personal class method DeviceManager.StartManageDevice() (class builds like GXDLMSReader, with same attribute), the private attribute "socket" of GXNet object becomes null and I can't send and receive data.
about this question, this works correctly with Tcp, but with Udp connections I can't use Attach() method: I only need to pass GXNet object in a thread?
but how is it possible GXNet.Send has its attribute 'socket' (being socket a IDisposable type) as UdpClient type? because, if I call back Send method (from GXNet), I'm using GXNet object, not UdpClient object, so the attribute socket will be null.
Hi,
Hi,
The reason for this is because you attach the GXNew client and it's released after you leave OnReceived.
Try to attach the net media in your thread.
BR,
Mikko
Hi Mikko,
Hi Mikko,
now it works.
Thanks
Hi Mikko,
Hi Mikko,
about this question, this works correctly with Tcp, but with Udp connections I can't use Attach() method: I only need to pass GXNet object in a thread?
Thanks
Hi,
Hi,
In UDP there are no connections. If you know the sender address and port you can send data directly.
BR,
Mikko
hi,
hi,
but how is it possible GXNet.Send has its attribute 'socket' (being socket a IDisposable type) as UdpClient type? because, if I call back Send method (from GXNet), I'm using GXNet object, not UdpClient object, so the attribute socket will be null.
I cannot understand this thing.
Thanks