re: Problems with webutils
- Posted by Ted Fines <fines at macalester.edu> Aug 02, 2001
- 439 views
Kat, Thanks for the reply & code snippet. I think I'm missing something basic with this. 1) In your code, you quit when you receive a '13'. Does '13' signify end of transmission? 2) Why do you drop the '10' character--won't that elminate returns? For example, the IMAP command A FIND ALL.MAILBOXES "*" might return quite a few lines (however many mailboxes the user has), such as: * MAILBOX INBOX * MAILBOX Accounts * MAILBOX ArcServe * MAILBOX Cisco * MAILBOX Corporate Time * MAILBOX DNS_DHCP * MAILBOX Euphoria * MAILBOX Linux * MAILBOX Novell * MAILBOX PMDF * MAILBOX Robots * MAILBOX Verisign * MAILBOX WASTEBASKET * MAILBOX deadletter a OK FIND ALL.MAILBOXES completed Won't it be bad if I delete out all of the \n characters? Isn't a '13' and a \n sent at the end of every line? Or more simply, how do I know how much data came back, and when I can stop looping for it? Thanks, Ted Kat wrote: It's a little time consuming to run, but it's fast enough, and it took no time to write it. I use that same function in the SMTP section (port25), and almost the same code in the irc client (any port). Specifying one byte at a time is safest, it won't hang waiting for anything if the connection is broken, but it's also the slowest if everything is working perfectly. I do not close the port until after the logout in any of the cases: -- sign off properly SendToServer(sock_connect[2],"QUIT\r\n") -- listen for +OK for a little while -- close the port after +OK or timeout -- clean up tcp4u -- clean up this application -- end The gotcha in IMAP, as i understand RFC 1203, is that the client-server can change the command/handshake eol terminator string from crlf to whatever they want. I tried to look up the latest data at www.imap.org but somebody broke the internet here and i can't reach many websites since about midnight. Kat