NC is a high level Socket binding for Windows. It derives from a stripped
down version of Claw.Sockets, with all Claw (www.rrsoftware.com), and
most Windows, specific aspects removed. It's only Windows dependencies
are WSAStartup, WSACleanup, and WSAGetLastError, which should be easily
replaceable for use under Linux, for instance. A simple example program,
GETJPG.ADB, is included. This demo fetches a webcam picture and saves it
on disk as pic.jpg
To compile and link the demo program
gnatmake -gnato -O2 getjpg
will compile and link. It needs access to libwsock32.a, so if it
doesn't find that you'll need to copy it from the Gnat lib directory.
Create a Console mode project (ie, lkc.bat, not lkw.bat) and do a
You will probably need to add "wsock32.lib" just before the "-map:%1.map"
in lkc.bat Note that Janus, with multiple Ada tasks mapped to a single
Windows thread, needs to use the nc-sockets-alt_gethostbyname.asm instead
of adb to avoid blocking on a DNS lookup. "make" should automatically
choose the asm over the adb file.
Create a Console mode project, making sure to include OA\apilib\
GETJPG.ADB simple usage example
NC.ADS Parent package holding global declarations
nc-sockets.ads main public spec
nc-sockets.adb main body
nc-sockets-alt_gethostbyname.ads internals for non-blocking DNS lookup
nc-sockets-datagrams.ads public spec for datagrams
nc-sockets-datagrams.adb body for datagrams
Copyright 2003 Tom Moran email@example.com Anyone may use in any way.
No warranties - this code is designed for educational use.