added comments, also refactored some parts of the UDP and TCPManagers. On the TCP side I think there was an bug (data was always null) and on the udp side there was a large bulk of if-else-cases which is now simpliefied.