Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Mar : Re: Get message from MSN Messenger server with INDY

www.cryer.info
Managed Newsgroup Archive

Re: Get message from MSN Messenger server with INDY

Subject:Re: Get message from MSN Messenger server with INDY
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Thu, 29 Mar 2007 23:02:49

"David" <focusme@yeah.net> wrote in message
news:460c8233@newsgroups.borland.com...

> Please notice that there is no "\r
" or other end-flag at
> the end of the last line "Hello! How are you?"

There does not need to be an end-of-data flag.  If you read the MSN
protocol spec (such as from
http://www.hypothetic.org/docs/msn/index.php), you will see that the
last parameter of the first line is the total length of all of the
data that follows the line break of the first line.  In the example
you showed, the length of the MSG payload is 133 byte.  The '?'
character at the end of the message text is indeed the 133th byte of
the overall payload data.

So what you can do is call ReadLn() to receive the first line (the
'MSG' line in your example), parse out the data length ('133' in the
example), call ReadString() or ReadStream() with that length, and then
finally parse that received data as needed.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive