Skip to content

StreamTransport::removeConsumer方法bug #70

@l505654754

Description

@l505654754

使用RtuMaster发送消息只要发生异常就会关闭连接调用到这个方法,而下次尝试打开连接又会先调用这个方法产生空指针从而打开失败。导致永远都连不上,除非自己创建新的RtuMaster实例

package com.serotonin.modbus4j.sero.messaging;
public class StreamTransport implements Transport, Runnable {

...

    /**
     * <p>removeConsumer.</p>
     */
    public void removeConsumer() {
        listener.stop();
        listener = null;
    }

...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions