method for parsing tcp command