SocketWrapper
A protocol oriented wrapper around the POSIX socket API written in Swift
Install / Use
/learn @obdev/SocketWrapperREADME
SocketWrapper
This is a POSIX socket API wrapper written in Swift.
It is intended for testing networking stuff in Little Snitch where exact control over the low-level socket API calls is important. Also, we wanted to try out some concepts in Swift, especially in regard to protocol oriented programming.
It is not intended as a general purpose networking library that makes your life as an app developer easier. There are other things for that out there.
A presentation of this code and its implementation was first shown to the public at a CocoaHeads meetup in Vienna on 2016-03-10.
TODO
Here’s a very incomplete list of things that could be added or changed:
- Implement support for other protocols than TCP. The low-level
Socketstruct probably doesn’t need any changes for that, but the higher-levelSocketTypesub-protocols don’t expose initializers for that. - getaddrinfo() returns a linked list of results and only the very first one is used for
connect()/accept(). That list should probably be traversed until those calls actually succeed.
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
