Your SlideShare is downloading. ×
[圣思园][Java SE]Java se lesson 21
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

[圣思园][Java SE]Java se lesson 21

302
views

Published on

Published in: Technology, News & Politics

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
302
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. JAVA SE Lesson 211. 客户端与服务器端之间的通信全部采用 XML 实现:1) 用户登录(type=1) :<?xml version="1.0" encoding="utf-8"?><message> <type>1</type> <user>zhangsan</user></message>2) 服务器端向所有客户端发送的在线用户列表(type=4) :<?xml version="1.0" encoding="utf-8"?><message> <type>4</type> <user>zhangsan</user> <user>lisi</user> <user>wangwu</user></message>3) 客户端向服务器端发送的聊天数据(type=2):<message><type>2</type>
  • 2. <user>zhangsan</user><content>chat message</content></message>4) 服务器端向所有客户端发送的聊天数据(type=3):<message><type>3</type><content>zhangsan: chat message</content></message>5) 关闭服务器端窗口(type=6):<message><type>6</type></message>6) 关闭客户端窗口(type=5):<message><type>5</type><user>zhangsan</user><content>client closed</content></message>
  • 3. 7. 服务器端确认客户端关闭(type=7)<message><type>7</type></message>8. 登录结果(type=8)<message><type>8</type><result>success</result></message>系统概览图: