Postgres

Solo disponible en BuenasTareas
  • Páginas : 195 (48618 palabras )
  • Descarga(s) : 0
  • Publicado : 30 de septiembre de 2010
Leer documento completo
Vista previa del texto
w w w .fr ee -e bo ok sdo w nl oa d.

or

g

TCP/IP Sockets in C#
Practical Guide for Programmers

w

w

w

.fr ee

-e

bo

ok

s-

do

w

nl

oa

d.

or

g

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 JavaCryptography 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 AlmerothTCP/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/IPSockets 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 Associate Editor Publishing Services ManagerProject Manager Cover Design Cover Image Composition Copyeditor Proofreader Indexer Interior printer Cover printer

Rick Adams Karyn Johnson Simon Crump Kyle Sarofeen Yvo Niezebos Design Getty Images Cepha Imaging Pvt. Ltd. Harbour Fraser Hodder Jacqui Brownstein Michael Ferreira Maple Press 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 contactthe 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 & TechnologyRights 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 MorganKaufmann publications, visit our Web site at www.mkp.com Printed in the United States of America 08 07 06 05 04 5 4 3 2 1

For Margie and Jacob, for their love and inspiration –David For my three girls: Lisa, Michaela, and Mackenzie –Jeff For my parents, Paul and Eleanor Calvert –Ken

This Page Intentionally Left Blank

Contents
Preface ix

1

Introduction 1 1.1 Networks, Packets,and Protocols 1.2 About Addresses 4 1.3 About Names 5 1.4 Clients and Servers 5 1.5 What Is a Socket? 6 1.6 Exercises 7

1

2

Basic Sockets 9 2.1 Socket Addresses 9 2.2 Socket Implementation in .NET 2.3 TCP Sockets 16 2.4 UDP Sockets 29 2.5 The .NET Socket Class 37 2.6 Exercises 57

15

3

Sending and Receiving Messages 59 3.1 Encoding Information 61 3.2 Composing I/O Streams 65 3.3...
tracking img