DM&P DOS Sockets Library

DSock Home Page: http://www.dmp.com.tw/tech/dmp-lib/dsock/ 2007/08/08

DM&P DOS Sockets

DSOCK is a DOS TCP/IP library for DMP product users who want to program under DOS. It provides simple C functions for programmer to write Internet applications. The DSock library download from our web site is test version. It will quit to DOS after 2 hours. Mail us to get normal version please. E-mail: info@icop.com.tw.

We use Turbc C 2.0 to compile DSock and we recommend you to use Borland C++/Turbo C++ to build your program. You can download Turbo C++ 1.01 form http://community.borland.com/article/images/21751/tcpp101.zip (2.63 MB)

Documents

Library Files

DSock library file download from our web site is a ZIP file. Decompress it and will you will get a directory "DSock". You can find a lot of examples in "DSock\Demo". All examples are compiled okay with Turbo C++ 1.01 and put in "DSock\Demo\EXE".

File Name Description
LIB.HTM DSock library reference.
LIB\DSOCK.H DSock library head file for C.
LIB\DSOCK.LIB DSock library for DOS, large mode.
LIB\DSOCK.CFG Default network configuration file.
LIB\PKTDRV\NE2000.COM Packet driver for RTL8019.
LIB\PKTDRV\PKTDRV.BAT DOS batch file to load RTL8019 packet driver.
LIB\PKTDRV\RTSPKT.COM Packet driver for RTL8139.
LIB\PKTDRV\PKTDRV2.BAT DOS batch file to load RTL8139 packet driver.
LIB\PKTDRV\796PKT.COM Packet driver for AX88796.
LIB\PKTDRV\PKTDRV3.BAT DOS batch file to load AX88796 packet driver.

Examples

Example Name Description
DEMO\BOOTP Use BOOTP/DHCP to get network setting from DHCP server.
DEMO\DNS To get IP address from domain name.
DEMO\FTPD FTP server example, default user name is "dmp" and default password is "dmp".
DEMO\HTTPD Web server example.
DEMO\SMTP A simple program to send mail.
DEMO\SMTPD SMTP server example.
DEMO\TELNETD Simple TELNET server example, default user name is "dmp" and default password is "dmp".
DEMO\TALK_S Talk Server example with multiple TCP connections.
DEMO\TALK_TCP Talk example with TCP.
DEMO\talk_tcp_win Talk (TCP) Windows version written with WinSock.
DEMO\TALK_UB Talk example with broadcast.
DEMO\talk_ub_win Talk (UDP) Windows version written with WinSock.
DEMO\TALK_UDP Talk example with UDP.
DEMO\talk_udp_win Talk (UDP) Windows version written with WinSock.
DEMO\SOCK_AP A start-up project for programmer that support FTP/HTTP/SMTP/TELNET.

Note:

How to Run Examples

Before running examples, you should load packet driver first.

RTL8019

The default I/O address and IRQ of DMP products are 0x320 and 5. Run NE2000.COM to install packet driver:


C:\DSOCK\DEMO\EXE>ne2000 0x62 5 0x320

where software interrupt 62H can be any number between 60H and 70H. Just run pktdrv.bat in directory "EXE" to load packet driver:


C:\DSOCK\DEMO\EXE>pktdrv (Load packet driver for RTL 8019)
C:\DSOCK\DEMO\EXE>ftpd   (Run any DSock example program)

RTL8139

For Vortex86, you should use RTL8139 packet driver:


C:\DSOCK\DEMO\EXE>rtspkt 0x62

where software interrupt 62H can be any number between 60H and 70H. Or run pktdrv2.bat in directory "EXE" to load packet driver:


C:\DSOCK\DEMO\EXE>pktdrv2 (Load packet driver for RTL8139)
C:\DSOCK\DEMO\EXE>ftpd    (Run any DSock example program)

AX88796

For M6117D with 100M LAN, you should use AX88796 packet driver:


C:\DSOCK\DEMO\EXE>796pkt 0x62 5 0x320

where software interrupt 62H can be any number between 60H and 70H. Or run pktdrv3.bat in directory "EXE" to load packet driver:


C:\DSOCK\DEMO\EXE>pktdrv3 (Load packet driver for AX88796)
C:\DSOCK\DEMO\EXE>ftpd    (Run any DSock example program)

Vortex86SX

For Vortex86SX with 100M LAN, you should use R6040 packet driver:


C:\DSOCK\DEMO\EXE>r6040pd 0x62

where software interrupt 62H can be any number between 60H and 70H. Or run pktdrv4.bat in directory "EXE" to load packet driver:


C:\DSOCK\DEMO\EXE>pktdrv4 (Load packet driver for Vortex86SX)
C:\DSOCK\DEMO\EXE>ftpd    (Run any DSock example program)

The default setting of network is on DSOCK.CFG. You should modified the default setup upon your network. After changing the DSOCK.CFG, you can run examples.

Support

If you have any problem with the DSock, mail to tech@dmp.com.tw please.


Jan Yin Chan Electronics Co., LTD. All rights reserved. Email us: info@dmp.com.tw