Msnp10 Protocol Analysis 05. Text Information [by progsoft]

Source: Internet
Author: User

The introduction below is divided into sending and receiving

Now you can create a session. If not, read the previous document again.

1. Send text information
Client sending> MSG 3 N 119/R/n
Mime-version: 1.0/R/n
Content-Type: text/plain; charset = UTF-8/R/n
X-MMS-im-format: fn = Arial; EF = I; CO = 0; cs = 0; pF = 22/R/n
Hello!

Syntax format:
MSG <SP> trid <SP> n <SP> total message length <CRLF>
Mime-version: 1.0 <CRLF>
Content-Type: text/plain; charset = UTF-8 <CRLF>
X-MMS-im-format: fn = parameter FN; EF = parameter EF; CO = parameter Co; cs = parameter Cs; pF = parameter pf <CRLF>
Message Body

MSG and N, indicating to send text information
Total message length, that is, the length of all bytes from mime to message body
Mime-version: 1.0, Fixed Header
Content-Type: text/plain; charset = UTF-8, Fixed Header, UTF-8 indicates message encoding type
X-MMS-im-format: fn = parameter FN; EF = parameter EF; CO = parameter Co; cs = parameter Cs; pF = parameter PF, text information format setting, including font, font size, color, font size, and other information
Message body. This is the text you want to send.

The X-MMS-im-format parameter is described later.

2. Sending input reminder
Client sending> msg 4 U 92/R/n
Mime-version: 1.0/R/n
Content-Type: text/X-msmsgscontrol/R/n
Typinguser: example@hotmail.com/R/n
Syntax format:
MSG <SP> trid <SP> U <SP> total message length <CRLF>
Mime-version: 1.0 <CRLF>
Content-Type: text/X-msmsgscontrol <CRLF>
Typinguser: Passport <CRLF>

MSG and U, indicating sending input reminder
The total length of the message, that is, the length of all bytes from mime to the end
Mime-version: 1.0, Fixed Header
Content-Type: text/X-msmsgscontrol <CRLF>, Fixed Header, specified type
Typinguser: User passport <CRLF>, user passport, refers to the user account

After this message is sent, all users in the same session will receive a notification that the user (example@hotmail.com) is entering.

3. receive text information
Server Response <MSG user01@hotmail.com user01_nickname 119/R/n
Mime-version: 1.0/R/n
Content-Type: text/plain; charset = UTF-8/R/n
X-MMS-im-format: fn = Arial; EF = I; CO = 0; cs = 0; pF = 22/R/n
Hello!

Syntax format:
MSG <SP> User passport <SP> User Name <SP> total message length <CRLF>
Mime-version: 1.0 <CRLF>
Content-Type: text/plain; charset = UTF-8 <CRLF>
X-MMS-im-format: fn = parameter FN; EF = parameter EF; CO = parameter Co; cs = parameter Cs; pF = parameter pf <CRLF>
Message Body

The user passport and the user name indicate the user account and name of the Information sender.
Other parameters are the same as "1. Send text information"

4. receiving input notifications
Server Response <MSG user01@hotmail.com user01_nickname 92/R/n
Mime-version: 1.0/R/n
Content-Type: text/X-msmsgscontrol/R/n
Typinguser: example@hotmail.com/R/n
Syntax format:
MSG <SP> User passport <SP> User Name <SP> total message length <CRLF>
Mime-version: 1.0 <CRLF>
Content-Type: text/X-msmsgscontrol <CRLF>
Typinguser: Passport <CRLF>

The user passport and the user name indicate the user account and name of the Information sender.
Other parameters are the same as "2. Sending an input reminder"

Congratulations, now you can simply implement the MSN function, including logging on to the user, changing the user status, and sending and receiving text information.
However, this is not complete. Other functions will be provided later.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.