Please also note that not all chapters have been completed at this time.
Table of Contents
|
1.1.1 How this book is organized |
|
1.4 C# and Visual Basic Users |
|
1.6.1 About Chad Z. Hower a.k.a. Kudzu |
|
1.6.3 About Hadi Hariri – Technical Editor |
|
1.7 Feedback and Discussion |
|
1.8.1.2 Borland Newsgroups |
|
1.8.2 Commercial Priority Support |
|
1.9 Additional Information |
|
1.10.2 Acceptable Use – Personal |
|
1.10.3 Acceptable Use – Corporate |
|
2.1 Introduction to Sockets |
|
2.1.16 Localhost (Loopback) |
|
2.1.27 Network Byte Order |
|
2.2.3 How Indy is Different |
|
2.2.4 Overview of Clients |
|
2.2.5 Overview of Servers |
|
2.2.7 Blocking vs Non-Blocking |
|
2.2.7.1 Programming Models |
|
2.2.7.5 History of Winsock |
|
2.2.7.6 Blocking is not Evil |
|
2.2.7.10 Pros of Non-Blocking |
|
2.2.7.11 Cons of Non-Blocking |
|
2.2.7.13 Files vs. Sockets |
|
2.2.7.15 Blocking File Write |
|
2.2.7.16 Non-Blocking File Write |
|
2.2.7.18 Aysnchronous Everything |
|
3.1.1.3 CheckForDataOnSource |
|
3.1.1.5 InputBufferIsEmpty |
|
3.1.1.6 InputBufferAsString |
|
3.1.1.8 InputBufferToStream |
|
3.1.3.5 Write (TIdBuffer) |
|
3.1.3.6 Write (TIdStream) |
|
3.1.5.2 Managing Your Own Work Transactions |
|
3.1.6.2 HTTP Client Live Stream Demo |
|
3.2 Detecting Disconnects |
|
3.2.2 Do you really need to know? |
|
3.2.3 I need to know now! |
|
3.2.4 EIdConnClosedGracefully |
|
3.2.4.1 Why Does This Exception Occur in Servers? |
|
3.2.4.2 Why is it an Exception? |
|
3.2.4.4 When is it an Error? |
|
3.3.2 Handling Exceptions |
|
3.3.3 Exceptions are not Errors |
|
3.3.4 Delphi Debugger Note |
|
3.3.6 Demo – Zip Code Client |
|
3.3.6.1 Zip Code Protocol |
|
3.4.1.1.1 The Role of Threads |
|
3.4.1.1.2 Servers on Fibers |
|
3.4.4.2 Included Thread Schedulers |
|
3.4.4.2.1 TIdSchedulerOfThreadDefault |
|
3.4.4.2.2 TIdSchedulerOfThreadPool |
|
3.4.5.1 OnExecute Implementation |
|
3.4.6.4 Creating a Command Handler |
|
3.4.6.5 Command Handler Support |
|
3.4.6.5.2 ReplyExceptionCode |
|
3.4.6.5.4 Other Properties |
|
3.4.6.6 Testing the New Command |
|
3.4.6.7 Implementing HELP |
|
3.4.6.9 Implementing DATETIME |
|
5.6 Constructing the Message |
|
6.2.1 How does POP3 differ? |
|
6.8.4 Retrieving Messages |
|
6.9 Demo – Simple retrieval in C# |
|
7.1 The Firewall Friendly Protocol |
|
7.2 Demo – Minimal Web Server |
|
8.5 The Chicken or the Egg? |
|
8.6 Defining a Custom Protocol |
|
10.1.1 IP Masquerading / Network Address Translation (NAT) |
|
10.1.2 Mapped Ports / Tunnels |
|
10.1.3 FTP User@Site Proxy |
|
10.2 Non Transparent Proxies |
|
11.1.1.1.1 SSLIOHandlerSocketBase |
|
11.1.1.1.1.1 SSLIOHandlerSocketOpenSSL |
|
12.3.1.1 Exceptions May Occur |
|
12.3.1.3 Non Aliased Host |
|
13.1 SSL – Secure Sockets |
|
13.1.1 Export Restrictions |
|
13.1.2 Secure HTTP / HTTPS |
|
13.1.5 Converting Certificates to PEM Format |
|
13.1.5.1 Exporting the Certificate |
|
13.1.5.2 Convert .pfx to .pem |
|
13.1.5.3 Splitting the .pem File |
|
13.1.6.1 Generating Certificate Requests |
|
13.1.6.2 Generating Self-Signed Certificates |
|
13.1.6.3 Preparing Indy/IntraWeb Certificates |
|
13.1.6.4 Extracting a Root Certificate |
|
13.1.6.5 Installing Certificates |
|
13.1.6.6 Obtaining SSL Buddy |
|
14 Using C# and Visual Basic |
|
14.2 What are TStream and IndyStrings? |
|
14.2.2 Conversion – Visual Basic |
|
14.4 What is the TId prefix for? |
|
15.2 Installing Concurrent Versions |
|
15.5 Major Changes and Additions |
|
15.5.2 Separation of Packages |
|
15.5.3 IOHandler Restructuring |
|
15.5.3.1 Method Signatures |
|
15.5.4.3 Raw Reads and Writes |
|
15.5.4.4 New Event Sigature |
|
15.5.7.3 FTP List Parsing |
|
15.5.8.1 Network Interfaces |
|
15.5.8.7 SuperCore Revealed |
|
16.1.1.3 Resource Protection |
|
16.1.2 Resolving Contention |
|
16.1.2.2 Atomic Operations |
|
16.1.2.3 Operating System Support |
|
16.1.2.4 Explicit Protection |
|
16.1.2.4.1 Critical Sections |
|
16.1.2.4.1.1 Win32 API Critical Sections |
|
16.1.2.4.1.2 Delphi 4 Standard Users |
|
16.1.2.4.2 TMultiReadExclusiveWriteSynchronizer (TMREWS) |
|
16.1.2.4.2.1 Delphi 4 and 5 |
|
16.1.2.4.3 Choosing Between Critical Sections and TMREWS |
|
16.1.2.5 Thread Safe Classes |
|
16.1.2.6 Compartmentalization |
|
16.2.2 Threading Advantages |
|
16.2.2.4 Multiple Processors |
|
16.2.2.5 No Serialization |
|
16.2.3 Processes vs. Threads |
|
16.2.4 Threads vs. Processes |
|
16.2.5 Hundreds of Threads |
|
16.2.5.1 Realistic Thread Limits |
|
16.2.6 Threadable and ThreadSafe |
|
16.2.7.3 Thread Variables |
|
16.2.8.2 TIdThreadComponent |
|
16.3 Eliminating Bottlenecks |
|
16.3.1 Common Bottleneck Causes |
|
16.3.1.1 Critical Section Implementation |
|
16.3.1.2.1 Performance Comparison |
|
16.3.1.3 Syncrhonizations |
|
16.3.1.4 User Interface Updates |
|
17.1.1 Piracy and Unconventional Wisdom |
|
17.1.1.2 Show Me the Money |
|
17.1.1.5 A Little Piracy Can Be Good Now and Then |
|
17.1.1.6 Financial Incentives |
|
17.1.1.7 Your Software Will *NEVER* be Pirate Proof |
|
17.1.1.8 Impact to YOUR Customers |
|
17.1.1.9 Draconian Solutions |
|
17.1.1.10 Creating Pirates |
|
17.1.1.11 Example 1: Microsoft |
|
17.1.1.12 Example 2: Record Companies |
|
17.1.1.14 Sell Benefits They Cannot Pirate |
|
17.1.1.15 Make it Cheaper to Buy |
|
17.1.1.16 Defend, Don’t Attack |
|
17.1.1.18 Goals of Piracy Prevention |
|
17.1.1.19 DO’s of Piracy Protection |
|
17.1.2 Biological Studies as the Basis of Encryption |
|
17.1.3 Outsourcing and Dead Presidents |
|
17.1.4 Developers are from Mars, Managers are from Venus |
|
17.1.4.1 A Developer Says |
|
17.1.4.1.1 I refactored it |
|
17.1.4.1.2 Its an elegant implementation |
|
17.1.4.1.3 I saved 2 bytes |
|
17.1.4.1.4 It doesn’t need testing |
|
17.1.4.1.5 It dosen’t need comments |
|
17.1.4.1.6 I reused some code |
|
17.1.4.1.7 Oops…. Never mind |
|
17.1.4.1.8 Its not a bug, its a documentation issue |
|
17.1.4.1.9 We need some more time |
|
17.1.4.2.1 I just read about x. I want the whole team to use x. |
|
17.1.4.2.3 I don’t need it “good”, I need it fast |
|
17.1.4.2.4 If it will take you 4 weeks, 4 of you can do it in a week, right? |
|
17.1.4.2.5 Can you make a use case diagram? |
|
17.1.4.2.6 Will this affect the critical path? |
|
17.1.6 What is important in life? Are C++ developers human? |
|
17.2.1 Why Delphi for .NET? |
|
17.2.2 Porting Delphi applications to Delphi for the .NET framework |
|
17.2.2.2.6 Unmanaged Code |
|
17.2.2.3 Compilers / IDE’s |
|
17.2.2.3.1 DCCIL (Diesel) |
|
17.2.2.4.1 .Net Framework |
|
17.2.2.4.6 WinForms or VCL for .Net? |
|
17.2.2.5.1 Mapping to CTS |
|
17.2.2.5.4 Custom Attributes |
|
17.2.2.6.1.1 Unsafe Types |
|
17.2.2.6.1.3 Unsafe Casts |
|
17.2.2.6.2 Deprecated Functionality |
|
17.2.2.7.1.1 Deterministic Destruction |
|
17.2.2.7.1.2 Non-Deterministic Destruction |
|
17.2.2.7.2 Garbage Collection |
|
17.2.2.8.1 Remove Unsafe Warnings |
|
17.2.2.8.2 Unit Namespaces |
|
17.2.2.8.4 Convert Project File |
|
17.2.2.8.5 Resolve Class Differences |
|
17.2.3 Developing single source Delphi – Win32, .NET, and Linux |
|
17.2.3.4 Platform Specific Features |
|
17.2.3.6.3 P/Invoke Usage |
|
17.2.3.6.3.1 SysUtils Patch |
|
17.2.3.7 .NET Common Error |
|
17.2.3.7.1 Object reference not set to something or other |
|
17.2.3.7.2 Object is not ready yet (XP style) |
|
17.2.3.7.3 It’s a .NET AV |
|
17.2.3.8 .NET – Things remembered |
|
17.2.3.8.2 Buffers (Untyped Variables) |
|
17.2.3.8.4.1 Delphi Globals |
|
17.2.3.9 Things Different |
|
17.2.3.9.1.2 Empty String |
|
17.2.3.9.1.3.1 StringBuilder |
|
17.2.3.9.1.3.2 AnsiString |
|
17.2.3.9.2 TList / TStrings |
|
17.2.3.9.3 Initialization and Finalization |
|
17.2.3.9.3.1 Initialization |
|
17.2.3.9.3.2 Finalization |
|
17.2.3.9.5.1 TStream – Win32 |
|
17.2.3.9.5.2 TStream – .NET |
|
17.2.3.9.5.3 TStream – Example |
|
17.2.3.9.5.4 TStream Problems |
|
17.2.3.9.8 Constructors and Destructors |
|
17.2.3.10.1 StringBuilder |
|
17.2.3.10.5 True Language Interoperability |
|
17.2.3.11 Handling Platform Differences |
|
17.2.3.11.2 Isolated Units |
|
17.3.1 Short Circuits or Faulty Circuits? |
|
17.3.2 Database Design and Modelling for Developers |
|
17.3.2.1.4 Surrogate Key (a.k.a. Non Decomposable) |
|
17.3.2.1.5 Intelligent Key (a.k.a. Decomposable Key) |
|
17.3.2.1.6 Referential Integrity (RI) |
|
17.3.2.3.1.1 Avoid Abbreviations |
|
17.3.2.3.1.2 Do Not Use Spaces |
|
17.3.2.3.1.3 Use Underscores |
|
17.3.2.3.1.4 Use ID and Code Suffixes |
|
17.3.2.3.1.5 Name Followed by a Modifier |
|
17.3.2.3.1.6 Liven Your Booleans |
|
17.3.2.3.1.7 Define Your Booleans |
|
17.3.2.3.1.7.1 Example Problem 1 |
|
17.3.2.3.1.7.2 Example Problem 2 |
|
17.3.2.3.1.8 Do Not Use Column Names That Match Parent Table Names |
|
17.3.2.3.2.1 Make Table Names Singular |
|
17.3.2.3.2.2 Use Referential Integrity |
|
17.3.2.3.2.3 A Database with a View |
|
17.3.2.3.2.4 Denormalization / Normalization |
|
17.3.2.3.2.5 Primary Keys |
|
17.3.2.3.2.5.1 Simple Keys |
|
17.3.2.3.2.5.2 Avoid Compound Keys |
|
17.3.2.3.2.5.3 Unique Names |
|
17.3.2.3.2.5.4 Foreign Keys |
|
17.3.2.3.2.5.5 Auto Generation |
|
17.3.2.4.1 Pause and Review |
|
17.3.3 Dude, Where’s my business logic? |
|
17.3.3.2 About this Article |
|
17.3.3.5 Evolution of a Problem |
|
17.3.3.6 What is Business Logic? |
|
17.3.3.6.1 Delete Customer |
|
17.3.3.8 Moving to the Middle Tier |
|
17.3.3.8.1 Slippery Slope |
|
17.3.3.8.5 Grow the Middle |
|
17.3.3.9.3 Database Administrators |
|
17.3.3.10.1 Architect Policing |
|
17.3.3.10.3 Management Education |
|
17.3.3.11 Further Reading |
|
17.3.5 Tier Pressure and Isolationism |
|
17.3.5.4.1 Storage Layer Driven Pattern |
|
17.3.5.4.2 Presentation Layer Driven Pattern |
|
17.3.5.4.3 Isolation Driven Pattern |
|
17.3.5.5 Partitioned Roles |
|
17.3.5.5.3 Tiny Teams and Lone Developers |
|
17.4.1 Easier Database Transactions – Extending the Using Statement to Perform Automatic Database Transactions |
|
17.4.2 Extending C# to Support SQL Syntax at Compile Time |
|
17.4.2.4 Neither Meat nor Fish |
|
17.4.2.5 Extreme Databases |
|
17.4.2.7.1.1 Tables / Views |
|
17.4.2.7.1.2 Stored Procedures |
|
17.4.2.8.2.1 Reading from a View |
|
17.4.2.8.2.1.1 Manual Read |
|
17.4.2.8.2.2 Accessing Columns |
|
17.4.2.8.2.3 Inserting a Row |
|
17.4.2.8.2.4 Updating a Row |
|
17.4.2.8.2.5 Filtering Data |
|
17.4.2.8.2.6 Other Operations |
|
17.4.2.10 Supported Databases |
|
17.4.2.11 Implementation Notes |
|
17.5.1 Mobile Agents – Software on the Move |
|
17.5.4 Remoting versus Mobile Agents |
|
17.5.5 No Single Solution |
|
17.5.6 No Client, no Server |
|
17.5.8.1 Single Code Base |
|
17.5.8.2 No Interprocess Communication |
|
17.5.10 Concepts and Terms |
|
17.5.11 Security using Gateways |
|
17.5.12.1 Data Collection |
|
17.5.12.1.1.1 Traditional |
|
17.5.12.1.1.2 Implementation |
|
17.5.12.2 Data Collection – Larger Data |
|
17.5.12.2.1.1 Implementation |
|
17.5.12.3 Network Mapping |
|
17.5.12.3.1.1 Implementation |
|
17.5.12.4.1.1 Implementation |
|
17.5.12.5 Finding Resources to Complete Task |
|
17.5.12.5.1.1 Implementation |
|
17.5.12.6 Distributed Processing |
|
17.5.12.7 Disconnected Processing |
|
17.5.12.7.1.1 Traditional |
|
17.5.12.10 Move from User to User |
|
17.5.12.10.1.1 Traditional |
|
17.5.12.10.1.2 Implementation |
|
17.5.12.11 Business Logic |
|
17.6.1.1 Like it or not, .NET is coming |
|
17.6.1.3 Reasons for .NET |
|
17.6.1.3.1 “It’s big, and it’s Microsoft.” |
|
17.6.1.3.2 Platform Potential |
|
17.6.1.3.3 Standardized, Rich Class Libraries |
|
17.6.1.3.4 The Future is Faster |
|
17.6.1.3.4.1 Future Exception |
|
17.6.1.3.5 Language Nuetral |
|
17.6.1.3.5.1 Improved Visual Basic |
|
17.6.1.3.5.2 Modernized C++ |
|
17.6.1.3.6 Saying good-bye, and good riddance |
|
17.6.1.3.6.1 Fewer Crashes |
|
17.6.1.3.6.2 Memory Corruption |
|
17.6.1.3.6.3 Access Violations |
|
17.6.1.3.6.4 Code Misjumps |
|
17.6.1.4.1 .NET has a Big Runtime. |
|
17.6.1.4.3 But I ported my application and it’s 100 times slower! |
|
17.6.1.4.4 Loss of Control |
|
17.6.1.4.5 .NET is Interpreted |
|
17.6.1.7 The Future of .NET |
|
17.6.2 Storing Application Options and User Preferences in .NET |
|
17.6.2.1 Why not INI, Registry or XML? |
|
17.6.2.1.3 Application.config |
|
17.6.2.2 What to use instead? |
|
17.6.3 For C# – For and For More |
|
17.6.4 Displaying and Working with Forms |
|
17.6.4.2.3 Returning a Result |
|
17.6.4.5 Keeping a Reference |
|
17.6.5 Obtaining Current DataTable Row for a DataGrid |
|
17.6.6 Dynamically Loading Assemblies |
(C) Atozed Software