 extension SpeechToTextWebSocket: WebSocketDelegate {
 
     func websocketDidConnect(socket: WebSocket) {
+        state = .Listening
         operations.suspended = false
         retries = 0
     }
 
     func websocketDidDisconnect(socket: WebSocket, error: NSError?) {
+        state = .Disconnected
         operations.suspended = true
         if isAuthenticationFailure(error) {
             connect()

     - parameter state: The state of the Speech to Text recognition request.
     */
    private func didReceiveState(state: SpeechToTextState) {
        return
    }


        transcriptions along with state information to update the internal `results` array.
     */
    private func didReceiveResults(wrapper: SpeechToTextResultWrapper) {
        if state == .StartedRequest {
            state = .ReceivingResults
        }

        var localIndex = wrapper.resultIndex
        var wrapperIndex = 0
        while localIndex < results.count {
