socket.io-client-java icon indicating copy to clipboard operation
socket.io-client-java copied to clipboard

How to get all messages from socket.on() listeners into a arraylist

Open xtr1993 opened this issue 3 years ago • 0 comments

when i use socket.io-client v1.0.1, i want to collect all the monitored data into an array buut after testing, it is found that the message is added to the array during the listening time, and the final array is still empty

socket.on(Socket.EVENT_MESSAGE, objects -> { String msg = initMsg(objects); linkedList.add(msg); LOGGER.info("receive: {}", initMsg(objects)); });

this code print logs: socket test =====> task_id:309618d1-7b53-4d8a-901e-bf83b28fe9ae, socketAddress: xxx:4100, message:

this end message is empty.

@darrachequesne

xtr1993 avatar May 25 '22 15:05 xtr1993