Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. GXByteBuffer Not Cleared After Processing The Push Messages

GXByteBuffer not cleared after processing the push messages

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By pramodahanya , 3 December, 2019
Forums
Gurux DLMS for Java

Dear,
With the latest version of gurux.dlms (3.0.6) the GXByteBuffer used for storing the received push messages is not cleared. The code we have is similar to the push receiver example and we didn't observe this behaviour in the older versions (2.X). Is this behaviour expected and we have to manually clear the buffer or are we doing something wrong or is it a bug?
Below is the code we are using:
public void onReceived(Object sender, ReceiveEventArgs e) {
//Some pre-processing
try {
synchronized (this) {
logDebug("Start message processing", true);
reply.set((byte[]) e.getData());
//Create separate clients for each meter due to the encryption
source = sources.get(senderId.toLowerCase());
GXDLMSSecureClient client = getOrCreateClient(source);
//I belive in earlier version(2.x) the buffer was cleared here.
client.getData(reply, source.getData());
if (source.getData().isComplete() && !source.getData().isMoreData()) {
try {
//Perform XML translation and business logic
} finally {
source.clearData();
source.setClient(null);
}
}
}
} catch (Throwable t) {
if (source != null) {
source.clearData();
source.setClient(null);
}
}
}

Attached a screenshot of the debug window with variables.

Best Regards
Pramod

Image
Profile picture for user Kurumi

Kurumi

6 years 6 months ago

Hi,

Hi,

This is by design. When we are communicating Over The Air the might be several push messages and reply in the same byte stream. That was causing that we can't clear the buffer automatically.
You need to clear the buffer.

BR,
Mikko

pramodahanya

6 years 6 months ago

Thanks Mikko

Thanks Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin