Bug fixes

Made sendMessage in MessagingSocket synchronized