Network Utility Methods Part 1: Parsing IP Addresses, Handling CIDR Ranges and Netmasks

Network Utility Methods Part 1: Parsing IP Addresses, Handling CIDR Ranges and Netmasks

Feb 24 2018 — Parsing things from text is like death and taxes, it is an absolute certainty that there will be a requirement requiring you to accept a blob of text as an input, wave a magic wand, and voila! You produce a beautiful object as the output of your function. In this post, I demonstrate how to parse IPv4 addresses from text (single or all IPs in text), as well as additional helper methods that work with IP addresses.

Task-based Socket Extension Methods (C# TPL)

Task-based Socket Extension Methods (C# TPL)

Feb 04 2018 — The Task-based Asynchronous Pattern (TAP) is the recommended way to write asynchronous code for .NET applications. As I explained in my last post, TAP is intended to replace the Asynchronous Programming Model (APM) and the Event-based Asynchronous Pattern (EAP), however many classes in the .NET framework still use these older patterns. Fortunately, these can be turned into TAP-style “awaitable” methods with relative ease. By doing so, you reap the benefits that come from working with Task (and Task) objects. In this post, I will convert a set of APM-style methods from the System.Net.Sockets namespace to TAP methods and provide an end-to-end example of how to use them in a generic TCP socket server.

Asynchronous Programming Best Practices in C#

Asynchronous Programming Best Practices in C#

Jan 29 2018 — Do the acronyms APM, EAP, and TAP mean anything to you? Have you ever wondered why there appears to be multiple redundant implementations of the same method in the .NET Framework? If so, you’ve come to the right place. I’ll try and explain why Microsoft felt the need to create three entirely distinct asynchronous programming patterns within the .NET framework and provide a few best practices to follow when writing asynchronous C# code.

How to Optimize Performance of Windows 10 and Visual Studio in VMWare Fusion

How to Optimize Performance of Windows 10 and Visual Studio in VMWare Fusion

Jan 26 2018 — Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. In this post, I will demonstrate how to create a packer template for AWS that automatically installs and configures NGINX on the most recent Ubuntu OS.