`
`.5.u: g" (c?c). (D E
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`Complete source
`code and design to
`create your own
`1M applications
`
`
`
`
`
`
`
`Dreamtech
`Software Team
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`Page 1 of 6
`
`Facebook's Exhibit No. 1026
`
`Page 1
`
`Page 1 of 6
`
`Facebook's Exhibit No. 1026
`Page 1
`
`
`
`Instant Messaging Systems: Cracking the CodeTM
`
`Published by
`Wiley Publishing, Inc.
`605 Third Avenue
`New York, NY 10158
`www.wi1ey.com
`
`This book is printed on acid-free paper.
`
`Copyright © 2002 by Wiley Publishing, Inc. All rights reserved.
`
`Published by Wiley Publishing, Inc.
`
`No part of this publication may be reproduced, stored in a retrieval system or transmitted in any
`form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise,
`except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without
`either the prior written permission of the Publisher, or authorization through payment of the
`appropriate per—copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA
`01923, (978) 750-8400, fax (978) 750—4744. Requests to the Publisher for permission should be
`addressed to the Permissions Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd.,
`Indianapolis, IN 46256, (317) 572-3447, Fax: (317) 572-4447, E-Mail:
`permcoordinator@wiley.com.This publication is designed to provide accurate and authoritative
`information in regard to the subject matter covered. It is sold with the understanding that the
`publisher is not engaged in professional services. If professional advice or other expert assistance
`is required, the services of a competent professional person should be sought.
`
`Wiley, the Wiley Publishing logo, and Cracking the Code are trademarks or registered trademarks
`of Wiley Publishing, Inc., in the United States and other countries, and may not be used without
`written permission. All other trademarks are the property of their respective owners. Wiley
`Publishing, Inc., is not associated with any product or vendor mentioned in this book.
`
`Library of Congress Control Number: 2002106774
`
`ISBN: 0-7645—4953-7
`
`Printed in the United States of America.
`
`10987654321
`
`lB/QW/QU/QS/IN
`
`
`
`Page 2 of 6
`
`Facebook's Exhibit No. 1026
`
`Page 2
`
`Page 2 of 6
`
`Facebook's Exhibit No. 1026
`Page 2
`
`
`
`Contents
`
`Preface
`
`vii
`
`
`
`
`
`
`
`
`
`
`
`
`
`Acknowledgmentsm
`
`Chapter 1: Introduction to Instant Messaging1
`
`A Brieinstmy ofInstantMessagmg ................................ 1
`The Advantages of Instant Messaging ....................................................................................... 2
`The Need for Instant Messaging ................................................................................................ 2
`The Future of Instant Messaging ......
`3
`
`Jabber Instant Messaging Model ............................................................................................... 3
`Introduction to the Instant Messaging Application .................................................................... 7
`Required Programming Techniques ........................................................................................ 10
`Summary .................................................................................................................................. 14
`
`Chapter 2: Designing the Instant Messaging Application15
`
`Application Design Considerations ......................................................................................... 15
`Database Design Considerations .............................................................................................. 16
`Server Module Design Considerations .................................................................................... 16
`Client Module Design Considerations ..................................................................................... 36
`Application Communication Standards ................................................................................... 40
`Issues Involved in Creating the Session......................... '. ......................................................... 45
`Issues Involved in Closing the Stream .....
`
`Summary .................................................................................................................................. 47
`
`Chapter 3: Instant Messaging Server (Java)48
`
`Java Web Services ................................................................................................................... 48
`
`Server Development ..................................................................................................... 56
`Inside the Server Application
`63
`Inside Java Web Services ........................................................................................................ 91
`
`Page 3 of 6
`
`Facebook's Exhibit No. 1026
`
`Page 3
`
`Page 3 of 6
`
`Facebook's Exhibit No. 1026
`Page 3
`
`
`
`
`
`
`
`
`
`Technical Documentation ...................................................................................................... 100
`
`Summary ................................................................................................................................ 21 1
`
`212
`Chapter 4: Instant Messaging Server (C#)
`Web Services ......................................................................................................................... 212
`
`Developing the Server............................................................................................................ 217
`
`Inside the Sewer Application...
`................................................. 222
`Inside a Web Service ............................................................................................................. 237
`Technical Documentation ...................................................................................................... 242
`
`Summary ................................................................................................................................ 333
`
`Chapter 5: The Instant Messaging Client (Java)334
`
`Basic Implementation of the Client ....................................................................................... 335
`Establishing a Connection with the Local Server .................................................................. 339
`Programing Client Requests ............................................................................................... 341
`
`Handling Responses .......................................................
`357
`Technical Documentation ...................................................................................................... 371
`
`Summary ................................................................................................................................ 493
`
`Chapter 6: Instant Messaging Client (C#)494
`Client Module Tasks .............................................................................................................. 494
`
`Server Responses ................................................................................................................... 508
`Technical Documentation ........
`
`
`Summary ................................................................................................................................ 623
`
`Chapter 7: Enhancing InstantMessaging 624
`
`Introduction to 12MB ................................. 624
`
`Design Techniques ................................................................................................................. 632
`Programming Client Requests ............................................................................................... 645
`
`Handling Responses...
`
`Summary ................................................................................................................................ 655
`
`Appendix A: What’s on theCD-ROM 657
`
`Appendix B: Instant Messaging Software Resources
`
`667
`
`Index 669
`
`Sun Microsystems, Inc. Binary Code License Agreement........................ 685
`
`
`
`Page 4 of 6
`
`Facebook's Exhibit No. 1026
`
`Page 4
`
`Page 4 of 6
`
`Facebook's Exhibit No. 1026
`Page 4
`
`
`
`
`
`
`
`
`
`
`Wiley Publishing, Inc. End-User License Agreement ............................... 702
`
`Important CD-ROM Information ............................................................... 704
`
`Page 5 of 6
`
`Facebook's Exhibit No. 1026
`
`Page 5
`
`Page 5 of 6
`
`Facebook's Exhibit No. 1026
`Page 5
`
`
`
`
`
`%
`
`isx
`S
`
`i
`i
`i
`l
`E
`i
`i
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`r
`
`‘3
`
`I
`
`l
`1
`
`
`by which people of varying age groups, especially youngsters, communicate with one another.
`
`Chapter 1
`
`Introduction to
`
`Instant Messaging
`
`Instant messaging (1M) is an Internet-based protocol application that allows one-to-one
`communication between users employing a variety of devices. The most popular form of IM is
`chatting, where short, text-based messages are exchanged among computers. With the advent
`of technologies such as Wireless Application Protocol (WAP) and the popularity of handheld
`devices such as mobile phones, Short Message Service (SMS) added a new dimension to
`instant messaging integration.
`
`SMS refers to sending and receiving text messages to and from mobile telephones. The text
`may be composed of words or numbers or may be an alphanumeric combination. SMS was
`created as part of the GSM Phase 1 standard. We think the first short message was sent in
`
`December 1992 from a PC to a mobile phone on the Vodafone GSM network in the UK. Each
`
`
`
`short message ranges between 70 160 characters.SMS has a store-forward capability; this
`means sending messages is possible even when the recipient is not available. The user is
`notified when a message is waiting, as with voicemail.
`
`Integration of SMS and instant messaging allows you to deliver short messages by using the
`instant messaging facility over handheld devices. Today, instant messaging can be availed free
`of cost. Software giants such as Yahoo!, Microsoft, and AOL are already offering free instant
`messaging facilities.
`
`A Brief History of Instant Messaging
`Instant Messaging has been around for more than two decades. The first major player to enter
`the arena of Instant Messaging was AOL, which launched its own version of instant messenger
`with a component used for managing all the incoming and outgoing messages and the list of
`friends, This component is popularly known as buddy list. Soon, Microsoft and Yahoo!
`followed AOL's trail. As a result, MSN and Yahoo! messenger appeared on the market with a
`variety of impressive new services. In its early days, instant messaging uses were restricted to
`splashing messages on bulletin boards. Gradually, instant messaging became a major area of
`interest for youngsters. Society acknowledges instant messaging as the most common means
`
`Page 6 of 6
`
`Facebook's Exhibit No. 1026
`
`Page 6
`
`Page 6 of 6
`
`Facebook's Exhibit No. 1026
`Page 6
`
`