Topaz Rabbit walks through building a simple bsdsocket.library based server for the Commodore Amiga using the C programming language. You'll learn about development environment setup, waiting for socket connections & other signals, and reading and printing client data to the console.
- Mastodon: https://oldbytes.space/@TopazRabbit
- Website: https://theindustriousrabbit.com/
- RSS: https://theindustriousrabbit.com/index.xml
Chapters
00:00 - Introduction 00:08 - Network socket basics on the Amiga 01:06 - Development environment setup 01:54 - Starting work on our server 02:20 - setup()/teardown() 02:53 - Control-C handling in SAS/C 03:24 - bind a socket to a port and interface and listen, and processor/networking endian-ness conversion 04:00 - Waiting for socket activity or Control-C using WaitSelect() 05:25 - Reading data from the client 05:56 - Amiga function names can be different from normal socket library function names 06:11 - setsockopt, TIME_WAIT, and SO_REUSEADDR 06:52 - Conclusion
References
Code:
- Server code on Hackerbun Gitea (https://code.hackerbun.dev/TheIndustriousRabbit/amiga-bsdsocket-coding/src/branch/main/server_in_c) Grab the code and follow along!
Documentation:
- AROS bsdsocket.library notes (https://en.wikibooks.org/wiki/Aros/Developer/Docs/Libraries/BSDsocket#Usage) Covers a lot of the Amiga-specific basics
- NetBSD socket programming (https://wiki.netbsd.org/examples/socket_programming/) Guide to using sockets on a BSD-based system
- Amiga bsdsocket.library autodocs (https://wiki.amigaos.net/amiga/autodocs/bsdsocket.doc.txt) Amiga function names and usage details
- SO_REUSEADDR example (https://stackoverflow.com/questions/24194961/how-do-i-use-setsockoptso-reuseaddr) Note that you don't get SO_REUSEPORT or SO_LINGER on the Amiga!
Setup:
- AmiTCP 4.3 SDK (http://aminet.net/package/comm/tcp/AmiTCP-SDK-4.3) You'll need this (or an equivalent) to compile this code
- Setting up the SDK (https://eab.abime.net/showthread.php?p=1294161) Forum post showing SAS/C and AmiTCP SDK setup
Credits
Music:
- "Industrious Ferret" by Kevin MacLeod https://incompetech.com CC-BY 3.0 (http://creativecommons.org/licenses/by/3.0/)