Connection and command parsing