`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`Complete source
`
`code and design to
`
`create your own
`
`IM 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 Code™
`
`Published by
`Wiley Publishing, Inc.
`605 Third Avenue
`New York, NY 10158
`www.wiley.com
`
`This bookis printed on acid-free paper.
`
`Copyright © 2002 by Wiley Publishing, Inc. All rights reserved.
`
`Published by Wiley Publishing, Inc.
`
`Nopart 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 paymentofthe
`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 trademarksorregistered 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 mentionedin this book.
`
`Library of Congress Control Number: 2002106774
`
`ISBN: 0-7645-4953-7
`
`Printed in the United States of America.
`
`10987654321
`
`1B/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
`
`PHLACE .....cccosercsoerveroscersosorseceesecessercocecsscnesoeseseesensononeorsassesessssasasnssassssacncossoroes Wil
`
`ACKnowledgment......ccccccvccecsoessvscsecsenoserssenenescesssnasesssscsessssassssecoesecscesensscseeKd
`
`Chapter 1: Introduction to Instant Messaging..........scsscsscsccsesssessscessossssessee
`
`A Brief History of Instant Messaging....ccsccccsccsecssesssesecssscsessssesessesssessesssvesssecseserssessnscavens 1
`The Advantages ofInstant Messaging ...........cceccssssssscsesssrssssescsescesevesssesecesvavesestesesonseaanacacenenes 2
`The Need for Instant Messaging .....ccccscscssssensssessnesscsessssssssssscessssseescessseseescseacscsvsssrsesessssesess 2
`
`wd
`The Future of Instant Messaging......
`JabberInstant Messaging Model....ccsscsssssesssssesessessssesessessssessssssesnsesssssnsssenssvssceveseesseen 3
`Introduction to the Instant Messaging Application...........ccsssssesesessesorsrsceccsessesssesstsreccsssavansnsene 7
`Required Programming Techniques .........ccseccessseessstetcsenstceesessesenesenssesrseenssesesesssenesseseseas 10
`SUIMUIMATY 0. seeccscescosstssensnssssesrstseansseeanevensecsensecsenassseneesseauacausensusterseseacssasasvesessssssauenesassvaseanyes 14
`
`Chapter 2: Designing the Instant Messaging Application. ........s.sccsesesrseree LS
`
`Application Design Considerations .........ccccseescsseccssseseseseesssscssessssssesssssatscssssssassevevavecasess 15
`Database Design Considerations........cssecssesessssetesssecesesscrsaescssensseserssesesisrcerssussusssesssunsasens 16
`Server Module Design Considerations 10.0... ccecsessscssessssscsssseecssstsseseseesssrssesvecsevssaseecsaserass 16
`Client Module Design Considerations .......ccccsseusssecsesecssssessessnesecossesresssenssessesesensueanseess 36
`Application Communication Standards.0..cccccscscssescssssecssesecssesssesessseseessssessssvanssstsscseseeees 40
`Issues Involved in Creating the Session....icseccseeeees Vieeeseeetetandeseneeseseesessesenssneasessasnessesaeets 45
`
`Issues Involved in Closing the Stream.....
`SUMMALY ..cececseseecnesscsseesessesstsseeeecsnsacesetssaeeseseecseatecssssssrssssssnasersseesesssuensessesstsenetssesassesecess 47
`
`Chapter 3: Instant Messaging Server (Java) .....csccssecssccssersecessocseccsserorsesseene 4B
`
`Java Web Services ......csscseseceeensesesesenetecseseessesssenesassevesssassessosseuevecnusrarsusseesssenvacsteavesneasees 48
`Server Development ..cscssssecccsceessssstervsssessarsosseasnesesesssacssssssrsessssssessssvessssseeessseveesseeees 56
`Inside the Server Application....
`«63
`Inside Java Web Services wcsssscseccsssectsesorsssesessavetesteessasatsseecsisassssssseassesssseesesveetecssesseneeess 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 .....cccccseccscssscssrsesssesecscssecsscsessscsesecerecersoneessssansesensecesasenseneeenaneens 100
`SUIMIMALY ...cccccsscstescesenessnensnsnecesseenssanensrensedennaneessssessananeonsnstnenerssenensceneseeneenersaneneennenngnsenes 211
`Chapter 4: Instant Messaging Server (Ci) .....ssssecsssersesrseessesonsesssssscessoeee 212
`Web Services ...ccccsccsssssssctcssscesssssnscescsssvsessneeenscneeeesesseesseneeereeseeeeeseseseeecssseeenseseeesaeeaeesaeapeneaaas 212
`Developing the Server...c..cccccsccssssssesecsenscsneresnesnersenssesessseeesuenssveenienesesresseserseansnnetes 217
`
`Inside the Server Application...
`cccisecceseesssesnssssnessneetieneeeeneneeisseasseseestssaresseansnenssatens 222
`Jnside a Web Service ..cccccccccssssssssscsresessssseesrenecseseecsssancsesessecnsesessesesesosesevseseersestensessenesseres 237
`Technical Documentation. .ccccecccccsccsescsesessecscesecsseassereesersenesseesesirsaetrsusescisesessessessasessrantneses 242
`SUIMIMALY ....cecsccceessseceesesesessesesseseseseenessenesesenenseneneaseeseenesererensecsenisvesecoteeersseserenesenseeesereanees ees 333
`Chapter 5: The Instant Messaging Cliemt (Java) .......sssssesssssssesseressssessersee S34
`Basic Implementation of the Client ........:ccccsssseceeesesssneneeneeecrssaneineetitaasiveessssenetosecensones 335
`Establishing a Connection with the Local Servero.oo 339
`Programming Client Requests ....ccsssescsesecsesserseesceesrreeeoesnisscaneerssctscerasesesersenerinanesienes 341
`
`Handling Responses.....ccccsesesseeseeseeeseeeeneneseiases
`357
`Technical Documentation ......cccsssccsscesscsrecsesssersscteseeceneceneetssesesseseeesesecesseotensanesseverereeesssenes 371
`SUMMALY ...eesceceecseesteseestssneersseesseveesssseesssseesesaeeseseneieoHeeuseueeaeeneeAeeAndL COOOL CUEHALGUGAESHSEOLOISERLEGHOES 493
`Chapter 6: Instant Messaging Client (Ci) ....cssessscssssssssssrsssreeseensessesseessee 494
`Client Module Tasks vuccccccccccstcvesstccessceseeesssessersesecrssseecersessesssscerennesseesecsssneesseneecesessrenenssnenes 494
`Server Responses .....sccccsseecesssssensessssssseesssnssscsseeseesesensesusenennsenscessananreensensaseennneeeenenseessenees 508
`
`Technical Documentation........
`SUIMUMALY s.sssssessssssecncsnecessnececensssssscsassnesassseasssnecscsusnussaesusssueseconsansnnenusoascncseeascneaunenusescaeuentsenese 623
`Chapter 7: Enhancing Instant Messaging.....ssssssscrsessserssessessssssssseeseeseseene O24
`
`Jntroduction to TAME vcccccccsscssssesessessestteresnesseseecresecsseneessscesereestevessecseeeecsenecnteasesnsasueseesses 624
`Design Techtiiques...cscccscsssssssessecssersenssesnessseenseneseresieuscsiesesestanscssesesssessinearsnseeney 632
`Programming Client Requests ........secseesersesssenseesessrsersessseneresrseensieeisenessteriresenersesseres 645
` Handling Responses...
`SUIMMALY ....eecccsececseseesstsessesssesnsneseneseessaneenenesseeessseanessseanesnenasenenernaeeeesseneneneceesnenserssensiseases 655
`Appendix A: What’s on the CD-ROM.......scssssscssssssssersesesssceseescssssssevsesveses OST
`
`Appendix B: Instant Messaging Software Resources........ssssessecssseerssesees O67
`
`TineX ...sccscssssssccscececorecscscnsscsecsscssonsscesosscesecessrenevessesessssosssacesorsesessecsecacoceseseeses OOD
`
`Sun Microsystems, Inc. Binary Code License Agreement........sscssseeesseoss 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.......c.ssssssssscesssssseeees 702
`
`
`
`
`
`
`Important CD-ROM Information.........sscssscssscssssssccsssocssesesscneszceceseseorseses 704
`
`Page 5 of 6
`
`Facebook's Exhibit No. 1026
`Page 5
`
`Page 5 of 6
`
`Facebook's Exhibit No. 1026
`Page 5
`
`
`
`
`
`i
`
`iii
`|
`
`|
`
`|
`
`Chapter 1
`
`introduction to
`instant Messaging
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`f
`
`|
`
`|
`
`|
`|
`
`by which people of varying age groups, especially youngsters, communicate with one another.
`
`
`
`Instant messaging (IM) 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.
`
`SMSrefers to sending and receiving text messages to and from mobile telephones. Thetext
`may be composed of words or numbers or may be an alphanumeric combination. SMS was
`created as part of the GSM Phase | standard. Wethink the first short message was sent in
`
`December 1992 from a PC to a mobile phone on the Vodafone GSM network in the U.K. Each
`
`
`
`short message ranges between 700160 characters.SMS hasa store-forward capability; this
`means sending messagesis possible even when the recipient is not available. Theuseris
`notified when a messageis waiting, as with voicemail.
`
`Integration of SMSand instant messagingallowsyou to deliver short messages by using the
`instant messagingfacility over handheld devices. Today, instant messaging can be availed free
`of cost. Software giants such as Yahoo!, Microsoft, and AOLare already offering free instant
`messaging facilities.
`
`A Brief History of Instant Messaging
`Instant Messaging has been around for more than two decades. Thefirst major player to enter
`the arena of Instant Messaging was AOL, which launchedits own version of instant messenger
`with a component used for managing all the incoming and outgoing messages and thelist of
`friends, This component is popularly known as buddy list. Soon, Microsoft and Yahoo!
`followed AOL'strail. 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
`
`