Network programming in .NET : with C# and Visual Basic .NET

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Publisher: Elsevier/Digital Press
Year: 2004

Language: English
Pages: 548
City: Amsterdam ; Boston

Contents......Page 3
Who should read this book?......Page 11
Part II: Network application design......Page 12
Conventions used in this book......Page 13
Further information......Page 14
Acknowledgments......Page 15
1.1 Introduction......Page 16
1.3 What can a network program do?......Page 17
1.4 IP addresses......Page 18
1.5 The network stack......Page 21
1.7 Internet standards......Page 22
1.8 What is .NET?......Page 24
1.9 Getting started......Page 26
1.10 Using Visual Studio .NET......Page 27
1.11 Using the .NET SDK......Page 31
1.11.1 Compiling with Visual Basic.NET......Page 34
1.12 Conclusion......Page 35
2.2 Streams......Page 36
2.2.1 Streams for files......Page 37
2.2.2 Encoding data......Page 43
2.2.3 Binary and text streams......Page 44
2.2.4 Serialization......Page 48
2.2.5 Writing a database to a stream......Page 59
2.3 Conclusion......Page 69
3.2 What is a socket?......Page 70
3.3 Creating a simple "hello world" application......Page 71
3.3.1 Writing a simple UDP client......Page 72
3.3.2 Writing a simple UDP server......Page 73
3.4.1 Writing a simple TCP/IP client......Page 77
3.4.2 Writing a simple TCP/IP server......Page 80
3.5 Debugging network code......Page 88
3.6 Socket-level networking in .NET......Page 90
3.7 Conclusion......Page 101
4.1 Introduction......Page 102
4.2.1 The HTTP request......Page 103
4.2.2 The HTTP response......Page 106
4.2.4 System.Web......Page 108
4.2.5 Posting data......Page 112
4.2.6 A note on cookies......Page 119
4.2.7 A WYSIWYG editor......Page 120
4.3 Web servers......Page 128
4.3.1 Implementing a Web server......Page 129
4.4 System.Net.HttpWebListener......Page 139
4.5 Mobile Web browsers......Page 143
4.6 Conclusion......Page 145
5.2 Sending an email......Page 146
5.3 SMTP......Page 147
5.3.1 Implementing SMTP......Page 148
5.4 Post office protocol 3......Page 155
5.4.1 Implementing POP3......Page 156
5.5 System.Web.Mail......Page 163
5.5.1 Attachments......Page 166
5.6 Mail application programming interface......Page 168
5.6.1 Accessing the address book......Page 171
5.6.2 IMAP......Page 173
5.6.3 Network news transfer protocol......Page 174
5.7 Conclusion......Page 176
6.2 Microsoft file sharing......Page 177
6.3 Netware file sharing......Page 178
6.4 An overview of FTP......Page 179
6.4.1 How FTP uses ports......Page 181
6.4.2 The FTP handshake......Page 182
6.4.3 Navigating folders......Page 184
6.4.4 FTP command reference......Page 185
6.4.5 Implementing FTP......Page 186
6.4.6 Implementing FTP with the Internet Transfer Control......Page 188
6.4.7 A more substantial implementation of FTP......Page 192
6.4.8 FTP support in .NET 2.0......Page 207
6.5 Conclusion......Page 208
7.1.1 Building a network from scratch......Page 209
7.2.1 Routers......Page 213
7.2.2 Firewalls......Page 214
7.3 Tunneling out of an enterprise network......Page 217
7.4 Avoiding the networking pitfalls......Page 219
7.4.1 Firewall tunneling......Page 220
7.5 Conclusion......Page 221
8.2 Cryptanalysis......Page 223
8.4 Asymmetric encryption......Page 226
8.5 Using RSA as asymmetric encryption......Page 227
8.6.1 Using 3DES as symmetric encryption......Page 232
8.7 Piracy protection......Page 238
8.8 Conclusion......Page 239
9.2 Authentication techniques......Page 240
9.2.1 IIS authentication......Page 241
9.3 Microsoft .NET Passport authentication......Page 243
9.4 Hashing information......Page 245
9.4.2 Using SHA......Page 247
9.6 Certificates......Page 249
9.7 Server certificates......Page 251
9.8 Client certificates......Page 252
9.8.1 Microsoft Certificate Services......Page 253
9.8.2 Reading certificates......Page 254
9.9 Permissions in .NET......Page 257
9.10 Financial network security......Page 259
9.10.2 ISO 8730......Page 260
9.10.4 Corporate transactions......Page 261
9.11 Conclusion......Page 262
10.2 Case study: The Google search engine......Page 263
10.3 Replication and redundancy......Page 265
10.4 Scalable network applications......Page 266
10.5 Future proofing......Page 267
10.6 Thread pooling......Page 268
10.6.1 Implementing a thread pool......Page 270
10.7 Avoiding deadlocks......Page 273
10.8 Load balancing......Page 274
10.9 Conclusion......Page 284
11.2 Tricks and tips to increase performance......Page 286
11.2.1 Caching......Page 287
11.2.2 Keep-alive connections......Page 288
11.2.4 Tweaking settings......Page 289
11.3.1 Multicast basics......Page 293
11.3.2 Multicast routing......Page 294
11.3.3 Implementing multicast......Page 295
11.4 Data compression......Page 300
11.5 Lossless compression......Page 301
11.5.1 Implementing ZIP compression......Page 302
11.6.1 Audio compression......Page 307
11.6.2 Image compression......Page 309
11.6.3 Video compression......Page 313
11.7 Conclusion......Page 314
12.2 DNS......Page 315
12.2.1 Implementing DNS MX......Page 316
12.3 Ping......Page 324
12.4 WHOIS......Page 331
12.4.1 Telnet......Page 336
12.5.2 RIP......Page 337
12.5.6 PPP......Page 338
12.6 WMI......Page 339
12.6.1 Reading WMI data......Page 340
12.6.2 Leveraging WMI......Page 343
12.7 Conclusion......Page 346
13.1 Introduction......Page 347
13.2 IP-level network tapping......Page 349
13.2.1 Interpreting raw network data......Page 354
13.2.2 IP packets in detail......Page 356
13.2.3 ICMP packets in detail......Page 358
13.2.4 TCP/IP packets in detail......Page 359
13.2.5 UDP packets in detail......Page 361
13.2.6 DNS packets in detail......Page 362
13.3.1 Using rvPacket and WinPCap......Page 364
13.3.2 Using PacketX and WinPCap......Page 370
13.4 Physical network tapping......Page 376
13.5 Conclusion......Page 386
14.1 Introduction......Page 388
14.2 Basic telephony......Page 389
14.3 Listening for incoming phone calls......Page 391
14.4 DTMF tones......Page 408
14.5 Audio playback......Page 410
14.5.1 Audio playback over TAPI......Page 422
14.6 Conclusion......Page 426
15.1 Introduction......Page 427
15.3 Implementing a message queue......Page 428
15.3.1 Queuing complex objects......Page 435
15.3.2 Transactions......Page 443
15.3.3 Acknowledgments......Page 445
15.4 Timeouts......Page 447
15.5 Journal......Page 449
15.6 Queued Components......Page 451
15.7 Security......Page 455
15.8 Scalability......Page 457
15.9 Performance issues......Page 459
15.10 Conclusion......Page 460
16.2 What is IPv6?......Page 461
16.3 The history of IPv6......Page 462
16.4 So what changes?......Page 463
16.5 IPv6 naming conventions......Page 464
16.6.1 Auto configuration......Page 465
16.7.1 IPv6......Page 466
16.7.3 Ping6......Page 467
16.7.4 Tracert6......Page 468
16.7.5 IPSec6......Page 469
16.7.6 Windows 2000 specific......Page 471
16.8 IPv6 routing......Page 472
16.8.1 Route determination process......Page 473
16.8.2 Administering the IPv6 routing table......Page 474
16.8.3 IPv6 routing advertisements......Page 476
16.9.1 The 6to4 protocol......Page 477
16.9.2 The ISATAP protocol......Page 479
16.10 IPv6 in .NET......Page 481
16.11 Conclusion......Page 487
17.2 Creating a Web service......Page 488
17.2.1 Deploying a Web service......Page 492
17.3 Using a Web service......Page 493
17.4 Asynchronous calls to Web services......Page 496
17.4.1 Wait handles......Page 497
17.4.2 Callbacks......Page 498
17.5 Interoperability......Page 500
17.6 Performance......Page 501
17.7 Security......Page 502
17.8 Web services enhancements......Page 504
17.8.1 Web service extensions: Attachments......Page 505
17.9 .NET remoting......Page 507
17.9.1 How remoting works......Page 508
17.9.2 Implementing remoting......Page 509
17.9.3 Asynchronous use of remote objects......Page 513
17.9.4 Deployment of a remoting service......Page 515
17.9.5 Configuration......Page 516
17.9.6 Hosting remote objects within IIS......Page 517
17.9.7 Hosting remote objects within a Windows service......Page 518
17.9.8 Distributed garbage collection......Page 522
17.10 Conclusion......Page 525
Index......Page 526