Open Mavlarn opened 11 years ago
Confirmed, this is not thread-safe, far from it actually. Just crashed on this myself. Will see if I can patch it up.
It seems that there are problems even when running stuff on a single thread, when messages are passed very quickly. I'm not sure if it is related, but I'll try to create a test case.
I want to use this lib in a multiple thread environment. I will create multiple SocketIO to connect the server, and send and get message. I checked the code to create connection, but I found it is possible to have a concurrent problem if I have many thread trying to create SocketIO object at the same time.
The related code is as below: static public IOConnection register(String origin, SocketIO socket) {