TCP/IP Networking

Amiga OS includes a fast and fairly full featured TCP/IP stack. The code name for this stack is Roadshow as explained in the documentation. End users have an assortment of GUIs and commands for controlling the stack. Programmers can expect the usual bsdsocket.library API with many extensions to make life easier.

One useful extension is the concept of a networking interface or NetInterface. A NetInterface most often represents a piece of networking hardware such as an Ethernet interface or wireless interface. Programmers can scan for interfaces and query their properties via the new API.

A rather uncommon feature of the Amiga TCP/IP stack is the socket options SO_SNDTIMEO and SO_RCVTIMEO. These provide timeouts for sockets on sending and receiving and can be extremely useful to avoid a blocked ISocket->connect() call which takes several minutes to return.

C Library Interface

Networking is such a common operation that most C libraries include networking in their API. The newlib.library standard library includes a networking API which may be used. So does the alternative clib2 library.

What is important to remember is that you cannot mix networking APIs. Either you use the ISocket interface or you use the C library's API. The reason for not mixing the two is that the C library will hide the socket file descriptors behind an opaque int type which may be mixed with files. Internally, the C standard library will call ISocket functions and perform setup and teardown for you. When you try and mix the two, the C library may be doing things behind the scenes which can cause undefined behaviour for your application. It is best to stick with one API (bsdsocket.library) or the other (newlib.library).