TCP/IP Sockets in C#
Practical Guide for Programmers
The Morgan Kaufmann Practical Guides Series
Series Editor: Michael J. Donahoo
TCP/IP Sockets in C#: Practical Guide for Programmers
David Makofske, Michael J. Donahoo, and Kenneth L. Calvert
Java Cryptography Extensions: Practical Guide for Programmers
Jason Weiss
JSP: Practical Guide for Java Programmers
Robert J. Brunner
JSTL: Practical Guide for JSP Programmers
Sue Spielman
Java: Practical Guide for Programmers
Zbigniew M. Sikora
The Struts Framework: Practical Guide for Java Programmers
Sue Spielman
Multicast Sockets: Practical Guide for Programmers
David Makofske and Kevin Almeroth
TCP/IP Sockets in Java: Practical Guide for Programmers
Kenneth L. Calvert and Michael J. Donahoo
TCP/IP Sockets in C: Practical Guide for Programmers
Michael J. Donahoo and Kenneth L. Calvert
JDBC: Practical Guide for Java Programmers
Gregory D. Speegle
For further information on these books and for a list of forthcoming titles,
please visit our website at http://www.mkp.com/practical
TCP/IP Sockets in C#
Practical Guide for Programmers
David B. Makofske
Akamai Technologies
Michael J. Donahoo
Baylor University
Kenneth L. Calvert
University of Kentucky
AMSTERDAM • BOSTON • HEIDELBERG • LONDON
NEW YORK • OXFORD • PARIS • SAN DIEGO
SAN FRANCISCO • SINGAPORE • SYDNEY • TOKYO
Morgan Kaufmann is an imprint of Elsevier
Senior Editor Rick Adams
Associate Editor Karyn Johnson
Publishing Services Manager Simon Crump
Project Manager Kyle Sarofeen
Cover Design Yvo Niezebos Design
Cover Image Getty Images
Composition Cepha Imaging Pvt. Ltd.
Copyeditor Harbour Fraser Hodder
Proofreader Jacqui Brownstein
Indexer Michael Ferreira
Interior printer Maple Press
Cover printer Phoenix Color
Morgan Kaufmann Publishers is an imprint of Elsevier.
500 Sansome Street, Suite 400, San Francisco, CA 94111
This book is printed on acid-free paper.
©2004 by Elsevier Inc. All rights reserved.
Designations used by companies to distinguish their products are often claimed as trademarks or
registered trademarks. In all instances in which Morgan Kaufmann Publishers is aware of a claim,
the product names appear in initial capital or all capital letters. Readers, however, should contact
the appropriate companies for more complete information regarding trademarks and registration.
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, scanning, or otherwise—without prior
written permission of the publisher.
Permissions may be sought directly from Elsevier’s Science & Technology Rights Department in
Oxford, UK: phone: (+44) 1865 843830, fax: (+44) 1865 853333, e-mail: permissions@elsevier.com.uk.
You may also complete your request on-line via the Elsevier homepage (http://elsevier.com)by
selecting “Customer Support” and then “Obtaining Permissions.”
Library of Congress Cataloging-in-Publication Data
Application submitted.
ISBN: 0-12-466051-7
For information on all Morgan Kaufmann publications,
visit our Web site at www.mkp.com
Printed in the United States of America
0807060504 54321