1. Tero Koskinen
  2. not-claw-sockets-linux-x86

Overview

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

Gnat:
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.

Janus:
  Create a Console mode project (ie, lkc.bat, not lkw.bat) and do a
make getjpg
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.

ObjectAda:
  Create a Console mode project, making sure to include OA\apilib\
in Project/Settings/Search.

Files:

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-alt_gethostbyname.adb    "
nc-sockets-alt_gethostbyname.asm    "
nc-sockets-b_helper.ads             "
nc-sockets-datagrams.ads            public spec for datagrams
nc-sockets-datagrams.adb            body for datagrams

Copyright 2003 Tom Moran tmoran@acm.org  Anyone may use in any way.
No warranties - this code is designed for educational use.