Archived Forum Post

Index of archived forum posts

Question:

Imap.FetchSingle returns null sometimes

Feb 14 '14 at 09:19

Intermittent issue with Imap.FetchSingle, before message fetching I check IsConnected and IsLoggedIn - both return true, after that I'm trying to fetch message and FetchSingle sometimes returns null. I check IsConnected and IsLoggedIn again, and IsLoggedIn is still true, but IsConnected is false. Why null, and why connection is lost? LastErrorText message provided below, there is no any useful information.

ChilkatLog: IsConnected: DllDate: Aug 15 2013 ChilkatVersion: 9.4.1.42 UnlockPrefix: ------------- Architecture: Little Endian; 32-bit Language: IOS Objective-C VerboseLogging: 1 --IsConnected --ChilkatLog


Answer

You provided the LastErrorText for the "IsConnected" property access. Remember: LastErrorText is for the last method call / property access on the object. If you call FetchSingle, and then access IsConnected before getting the LastErrorText, then you've already overwritten the LastErrorText that contained the FetchSingle information.

PS> If posting LastErrorText's please use "pre" tags to maintain formatting and line-endings.


Answer

Thank you for your reply, here is the correct LastErrorText. This error occurs only on real device, on iOS simulator works fine. And this is always the first of several FetchSingle requests.

  FetchSingle:
    DllDate: Aug 15 2013
    ChilkatVersion: 9.4.1.42
    UnlockPrefix: ---------
    Architecture: Little Endian; 32-bit
    Language: IOS Objective-C
    VerboseLogging: 1
    fetchSingleEmailObject:
      fetchSingleEmailObject:
        msgId: 80
        isUid: 1
        FetchSingleComplete:
          fetchCommand: aaam UID FETCH 80 (FLAGS INTERNALDATE BODY[])
          ImapCmdSent: aaam UID FETCH 80 (FLAGS INTERNALDATE BODY[])
          sendCommand: Elapsed time: 1 millisec
          rcvUntilMatchStringQP:

          dbReceived0: 
          tlsRecvAppData:
            readIncomingTls_appData:
              readTlsRecord:
                TLS 1.0, Application, sz=51
                macLen: 20
                decryptedMsg: [aaam BAD UID not allowed now.
]
              --readTlsRecord
            --readIncomingTls_appData
            rcvAppData: success, nReceived = 31
          --tlsRecvAppData
          startIdx: 0
          dbReceived: aaam BAD UID not allowed now.

          Found match string.
          ImapCmdResp: aaam BAD UID not allowed now.
        --FetchSingleComplete
        fetchSingleComplete: Elapsed time: 195 millisec
      --fetchSingleEmailObject
    --fetchSingleEmailObject
    Failed.
  --FetchSingle
--ChilkatLog