refactored SocketHandler

logging when message lengths/types are out of range
handleData(): KISS