Home > Back-end >  Based on socket chat bug: null pointer exception
Based on socket chat bug: null pointer exception

Time:09-19

Why am I in the client after the success of the connection will change the contain socke threads in the research, but when I want to receive messages in the chat panel, it can't find change thread, the null pointer errors?

CodePudding user response:

Complete error message

CodePudding user response:

What's the matter with your sender is generated first? And multi-threaded Shared resources you are unlocked, how do you ensure that the data synchronization? Is your st start, how to guarantee the hashMap information has not been modified?

CodePudding user response:

refer to the second floor qybao response:
your sender first is how to generate? And multi-threaded Shared resources you are unlocked, how do you ensure that the data synchronization? Is your st start, how to guarantee the hashMap information has not been modified?
my sender took it from a database, and then is indeed have to join in the hash, you can print out, at the back of the st start running, I'm not modify the content of the hash, I suddenly thought of, is supposed to be my chat panel and deposited in the hash is not the same thread, so don't get,
  • Related