modified the ProtocolSocket class in a way that will hopefully prevent starvation on the sendMessage method