-*- coding: cp852 -*-

This program is released to the Public Domain.

* INTRODUCTION *
This is DJGPP Socket Wrapper for MS Network Client (v3).  It is
assumed to be an equivalent for dos_sock.lib from Microsoft TCP/IP
Sockets Development Kit, which originally was made for real mode
programming. With this library you can do socket stream and datagram
communication.

Here you will find important information about MS Network Client:
http://www.jacco2.dds.nl/samba/dos.html#msclient 

I made this wrapper because I need remote access (SMB) to files and
directories together with Berkeley socket communication in DJGPP on
DOS machine.

This library was made by analysing original, real mode, dos_sock.lib
wrapper.  Or rather its disassembled and fixed to work in DPMI16
version.

This is version 0.1, and I made following socket functions available:
socket, bind, listen, accept, send, sendto, recv, recvfrom, select,
ioctl, close_socket, gethostname.

If you are interested in more functions (like getservbyname,
socksetopt and few more), you are welcome to contribute! I did not
make them because I do not need them right now. 

* HOW TO COMPILE AND USE IT *
You can compile this library with 'make', but before you should
execute mkdir.sh to create working folders.  To use the library in
your application you must link libmsock.a file and use header files
from inc directory. Be carefull about conflicts with possible similar
files from DJGPP or some network library. Personally, I copied these
files to DJGPP/include overwriting original files (I use DJGPP 2.04).

I attach few test programs to this package.  You can compile them with
'make test'. When you run select.exe you can use telnet on client side
to test.

In test/windows directory you can find 2 programs to send some data
from MS Windows, they both can be compiled using mingw32-gcc
(www.mingw.org); use 'make wtest'.

* IMPORTANT NOTES * 
It is assumed that default transfer buffer (__tb) is at least
1024*10+64 bytes.  64 bytes for command (used in locater.c) and
1024*10 bytes for its parameters (used in socket.c).  Parameters
memory area contain data to send or buffer to receive data if it is
recv or recvfrom function.  So if you want to send more data in one
send command or receive more than it is possible to fit in buffer
there will be proper error returned.  You can resize transfer buffer
by changing def_nBufSize in socket.c file. But you must be also
carefull on size of DJGPP transfer buffer (you can change its size
using stubedit program, read on in DJGPP FAQ).  Microsoft wrote that
UDP send size is limited to 1400 bytes.

* CONTRIBUTE *
If you want to contribute than in doc directory you can find stack.dia
file which is scheme (for Dia, http://projects.gnome.org/dia/) of
dos_sock.lib program's stack for few functions. All other functions
work the same way.

* CONTACT *
Tomasz Zbroek
t.zbrozek@upos.com.pl 
(or scianagoryczy@wp.pl)


* LINKS *

Important DOS networking links:

http://www.jacco2.dds.nl/samba/dos.html
http://lazybrowndog.net/freedos/


other (better & Free :) networking for DOS:

packet drivers: http://www.crynwr.com/
Wattcp: http://www.erickengelke.com/wattcp/
Watt32: http://www.bgnett.no/~giva/








