Skip to content

li3317/Hands-On-Network-Programming-with-C

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hands-On Network Programming with C

Hands-On Network Programming with C

This is the code repository for Hands-On Network Programming with C, published by Packt.

Learn socket programming in C and write secure and optimized network code

What is this book about?

Network programming, a challenging topic in C, is made easy to understand with a careful exposition of socket programming APIs. This book gets you started with modern network programming in C and proper usage of the relevant operating system APIs.

This book covers the following exciting features:

  • Uncover cross-platform socket programming APIs
  • Implement techniques for supporting IPv4 and IPv6
  • Understand how TCP and UDP connections work over IP
  • Discover how hostname resolution and DNS work
  • Interface with web APIs using HTTP and HTTPS
  • Acquire hands-on experience with the email protocol (SMTP)
  • Gain real-world expertise with practical network applications
  • Explore new approaches for the Internet of Things (IoT)

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

/*sock_init.c*/

#if defined(_WIN32)
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#pragma comment(lib, "ws2_32.lib")

Following is what you need for this book: If you're a developer or a system administrator who wants to enter the world of network programming, this book is for you. Basic knowledge of C programming is assumed.

Build Status Build status

This repo contains the code which accompanies the book "Hands-On Network Programming with C", written by Lewis Van Winkle. The code is released under the MIT license.

Unless otherwise noted, all programs will compile cleanly on Windows, Linux, and macOS, and as C or C++. Code is tested with MinGW and Visual Studio on Windows, gcc and clang on Linux and macOS.

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

  • chap06/web_get.c A minimal HTTP client which will download a web resource from a given URL.

Chapter 7

Chapter 8

Chapter 9

The examples in this chapter use OpenSSL. Be sure to link against the OpenSSL libraries when compiling (-lssl -lcrypto).

Chapter 10

The examples in this chapter use OpenSSL. Be sure to link against the OpenSSL libraries when compiling (-lssl -lcrypto).

Chapter 11

The examples in this chapter use libssh. Be sure to link against the libssh libraries when compiling (-lssh).

Chapter 12

This chapter doesn't include any example programs.

Chapter 13

Chapter 14

This chapter doesn't include any example programs.

With the following software you can run all code files present in the book (Chapter 1-14).

Required Software

Following along with the code in this book requires that you to have access to a C compiler on a standard operating system. The example programs in this book were carefully tested on Windows, Linux, and macOS. They were tested using the gcc, clang, and Microsoft Visual Studio compilers. All of the code in this book will compile as either C or C++.

In addition, the code examples in Chapter 9, Loading Secure Web Pages with HTTPS and OpenSSL, and Chapter 10, Implementing a Secure Web Server, require that you have the OpenSSL library installed.

Chapter 11, Establishing SSH Connections with libssh, requires that the libssh library is installed.

Instructions for installing all of the require software are provided in the the appendices. See Appendix B, Setting Up Your C Compiler On Windows, Appendix C, Setting Up Your C Compiler On Linux, and Appendix D, Setting Up Your C Compiler On macOS, for compiler setup. A complete list of the example programs provided is given in Appendix E, Example Programs.

No non-free software is required to follow along with any of the examples in this book.

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.

Get to Know the Author

Lewis Van Winkle is a software programming consultant, entrepreneur, and founder of a successful IoT company. He has over 20 years of programming experience after publishing his first successful software product at age twelve. He has over 15 years of programming experience with the C programming language on a variety of operating systems and platforms. He is active in the open-source community and has published several popular open-source programs and libraries, many of them in C. Today, Lewis spends much of his time consulting, where he loves taking on difficult projects that other programmers have given up on. He specializes in network systems, financial systems, machine learning, and interoperation between different programming languages.

Suggestions and Feedback

Click here if you have any feedback or suggestions.

About

Hands-On Network Programming with C, published by Packt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 92.6%
  • Shell 3.6%
  • Batchfile 3.4%
  • HTML 0.4%