kenta-shimizu / secs4java8

This library is SEMI-SECS-communicate implementation on Java8.
Apache License 2.0
109 stars 54 forks source link

SecsMessageReceiveListener does not work #6

Closed skay0424 closed 2 years ago

skay0424 commented 2 years ago

only SecsLogListener can receive meesage ,SecsMessageReceiveListener does not work ! can you tell me the principle?

kenta-shimizu commented 2 years ago

'SecsLogListener' and 'SecsMessageReceiveListener' have nothing to do with each other.

'SecsCommunicator#addSecsMessageReceiveListener' receive only Primary-message, not receive Reply-message. 'SecsCommunicator#send' return Optional<SecsMessage>, Optional has value if Reply-message exist.

If you receive both message, use 'SecsCommunicator#addReceiveMessagePassThroughListener'.

skay0424 commented 2 years ago

'SecsLogListener' and 'SecsMessageReceiveListener' have nothing to do with each other.

'SecsCommunicator#addSecsMessageReceiveListener' receive only Primary-message, not receive Reply-message. 'SecsCommunicator#send' return Optional, Optional has value if Reply-message exist.

If you receive both message, use 'SecsCommunicator#addReceiveMessagePassThroughListener'.

Thanks for you answer very much! but,I use your simulator test,The LogListener is aways can receive message,i thought maybe i could just only registry LogListener!