Protected the socket tree and the tcp queues.Reverted the tree implementation