By dlmsDeveloper, 29 December, 2022 Forums Gurux.Net Dear Gurux Manager Hi I use gurux.net and gurux.dlms C# for Read my devices but i cant handle multiple meter read with an open port i use this for open port : GXNet server = new GXNet(NetworkType.Tcp, 777); server.HostName = "x.x.x.x"; server.Port = 5060; server.Open(); server.OnClientConnected += OnClientConnected; and OnClientConnected method is: GXNet server = (GXNet)sender; try { using (GXNet cl = server.Attach(e.Info)) { ReadMeter(cl, e.Info)) } } catch (Exception ex) { } in this case when the second meter is connected, it waits until the first meter is disconnected. How can I read all these together? thanks. Hi, Hi, You need to create a thread in OnClientConnected that then reads the meter. In that way, it's not blocking the connection. Something like this: GXNet media = server.Attach(e); Thread thread = new Thread(new ParameterizedThreadStart(ReadMeter)); thread.Start(media); BR, Mikko Log in or register to post comments
Hi, Hi, You need to create a thread in OnClientConnected that then reads the meter. In that way, it's not blocking the connection. Something like this: GXNet media = server.Attach(e); Thread thread = new Thread(new ParameterizedThreadStart(ReadMeter)); thread.Start(media); BR, Mikko
Hi,
Hi,
You need to create a thread in OnClientConnected that then reads the meter. In that way, it's not blocking the connection.
Something like this:
GXNet media = server.Attach(e);
Thread thread = new Thread(new ParameterizedThreadStart(ReadMeter));
thread.Start(media);
BR,
Mikko