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 11 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 11 months ago

Thanks Mikko

Thanks Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 10/13/2026 - 12:00
    gurux.dlms.java 4.0.97
  • Tue, 09/22/2026 - 14:02
    Gurux.DLMS.Net 9.0.2609.2201
  • Mon, 09/21/2026 - 10:18
    Gurux.DLMS.Net 9.0.2609.2101
  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202

New forum topics

  • Association refresh related issue
  • Need RJ45 pin configuration for Saral 300 and Saral 305 Secure meters
  • Query Regarding Class 63 Status Mapping Support in Gurux DLMS Python
  • Inhemeter
  • DLMS Server - Profile Generic - can't add too many items to profile generic capture object - how to set maximum profile entries
More

Who's new

  • Eric@li
  • Asier Sierra
  • BlessyAnn
  • sravya.thota@m…
  • Diwakar
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin