Library

Socket

Synchronous socket networking and DNS lookup

MVP
Dependencies

No library-level dependencies

SaneCppSocket.h is a library implementing synchronous socket networking and DNS lookup.

Dependencies

  • Dependencies: (none)
  • All dependencies: (none)

Dependency Graph

Features

Class Description
SC::SocketDescriptor SC::SocketDescriptor
SC::SocketServer SC::SocketServer
SC::SocketClient SC::SocketClient
SC::SocketIPAddress SC::SocketIPAddress
SC::SocketDNS SC::SocketDNS
SC::SocketNetworking SC::SocketNetworking

Details

Status

MVP Simple synchronous TCP client / server workflow is supported, but it would need better testing.

Blog

Some relevant blog posts are:

Description

  • SC::SocketDescriptor can create and destroy the OS level socket descriptor.
  • SC::SocketServer can SC::SocketServer::listen on a given port / address and SC::SocketServer::accept a new client socket.
  • SC::SocketClient can SC::SocketClient::connect, SC::SocketClient::write, SC::SocketClient::read and SC::SocketClient::readWithTimeout.
  • SC::SocketIPAddress allows creating an ip address native object from a SC::StringView and port.
  • SC::SocketDNS class allow resolving a StringView to an IP address.
  • SC::SocketNetworking initializes WinSock2 for current process.

SocketDescriptor

SocketServer

SocketClient

SocketIPAddress

SocketDNS

Roadmap

Usable

  • Add UDP specific socket operations

Complete Features:

  • To be decided

💡 Unplanned Features:

  • None so far

Statistics

Type Lines Of Code Comments Sum
Headers 145 225 370
Sources 894 156 1050
Sum 1039 381 1420