中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-15 05:02
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS开发编程 & 发展交流 (开发室) » [Help] Do I need to set up a network before doing network programming?
Printable Version  2,104 / 15
Floor1 forzhanghua Posted 2003-09-22 00:00
初级用户 Posts 21 Credits 169
Experts, I have a very dumb question I want to ask everyone:
I'm using the socket programming provided by wattcp now, and I want to ask: sockets operate on IP addresses, so that means before I program I have to set the machine's IP and gateway. How do I set the machine's IP under DOS? Is it enough to just use the normal DOS networking method?
Floor2 问题 Posted 2003-09-23 00:00
初级用户 Posts 3 Credits 107
Let me teach you a simple but labor-intensive method:
Install NT4.0,
After installing it, run the client tool package creation program from Administrative Tools (for network communication installation under DOS, use the full NT4.0 CD)
Installing an NE2000 network card is relatively simple!
For PCI interface ones you have to modify it yourself (use NE2000, it's simpler)
With the communication boot package you have, you can start really testing the communication program you wrote under DOS!
Note: DOS with communication installed under Win9x can also achieve a certain level of DOS communication programming; (but I still think pure DOS is better)
DOS under the Win9x GUI has a lot of unrelated interrupts! For example: modifying the machine name is not very easy... it will conflict with Win9x itself!
Under DOS you don't need to reboot to modify the machine name, but under Win9x you do, plus a whole series of other problems... so I suggest that if you're just learning, it's best not to involve
too many other complicated problems!
Floor3 forzhanghua Posted 2003-09-23 00:00
初级用户 Posts 21 Credits 169
Question:
I can't understand what you're saying?
Floor4 问题 Posted 2003-09-24 00:00
初级用户 Posts 3 Credits 107
If you don't understand this, then it'll be troublesome for you!
Because DOS is not as convenient as Windows for writing network programs.
In Windows, building a network only takes a couple of mouse clicks,
but under DOS you have to configure the network manually, such as configuring the network card, protocols...
And you also need to know something about the net command.
Like your question -- "Do I need to set up a network before doing network programming?"
Under DOS you must learn DOS networking.
Otherwise it'll be very hard for you to write programs!
Right now you'd better go find some materials on DOS networking!
Floor5 秋蝉 Posted 2003-09-24 00:00
初级用户 Posts 19 Credits 152
Very simple: pktdrv driver + tcp.cfg configuration
Floor6 forzhanghua Posted 2003-09-26 00:00
初级用户 Posts 21 Credits 169
From what I see, wattcp operates on IP. Right now I'm using Microsoft Network Client 3.0 for networking, but after changing protocol.ini and rebooting, the screen shows this:
PRO0012E:Multiple protman name in PROTOCOL.INI
3Com DOS Etherlink III Network Driver V2.0
ERROR:No network adapter with specified IOADDRESS
ERROR:Initialization failure.Driver will not be installed.
I once saw that there were both and in protocol.ini, so I deleted one of them, and then only the last two errors were left, but no matter what I do I can't solve them. Could some expert help me! Thanks
Also, what does Qiuchan mean? I have pktdrv, but where is tcp.cfg, or what comes with it?
Floor7 秋蝉 Posted 2003-09-28 00:00
初级用户 Posts 19 Credits 152
I thought that if you want to use the socket "programming" provided by wattcp, you only need to prepare the pktdrv driver + tcp.cfg configuration. tcp.cfg is explained in the wattcp documentation (the text includes settings for IP address and gateway information), and there is absolutely no need for extra networking setup (definitely).

If you're setting up a network for file management or something like that, then there's no need for wattcp, right?
Also, qiuchan is a kind of insect, hehe, it has nothing to do with Diaochan

Floor8 forzhanghua Posted 2003-09-28 00:00
初级用户 Posts 21 Credits 169
Although you have nothing to do with Diaochan, I think you're still a very handsome guy.
What I want to achieve now is TCP communication under DOS. I only saw a wattcp.cfg file in wattcp, I didn't see tcp.cfg. Do you mean that I can directly write the IP and gateway into the *.cfg file, and when the program runs it will set this machine's IP to the value I set?
Floor9 秋蝉 Posted 2003-09-29 00:00
初级用户 Posts 19 Credits 152
I used tcp.cfg and got it working in testing. You can try wattcp.cfg, it should also work, they're both just text editing.
I suggest avoiding conflicts with other network drivers under pure DOS, then using wattcp's own test program for testing, and only then writing your own communication program
You're right that the local machine's IP address is determined in tcp.cfg!
And you're also right if you say I'm an ugly guy! Haha!
Floor10 forzhanghua Posted 2003-09-29 00:00
初级用户 Posts 21 Credits 169
Qiuchan, why are you being so modest? At the very least your skill is unbelievably cool! ^_^
I used wattcp.cfg to debug the program. When the program runs, I found that it stops at a "printf" statement in that config file and doesn't move, like it crashed (by the way, what is the standard for calling it a crash under DOS)? What's going on?
Also, did you add your tcp.cfg manually yourself?
Thanks!
Floor11 秋蝉 Posted 2003-09-30 00:00
初级用户 Posts 19 Credits 152
Floor12 forzhanghua Posted 2003-10-08 00:00
初级用户 Posts 21 Credits 169
Qiuchan, where did you download your wattcp? In my wattcp there is only a wattcp.cfg under bin, which is also more or less a configuration file, except it's very complicated, as follows:
print = "Waterloo TCP/IP setup" ; optional key/value
my_ip = 192.168.1.2 ; really is 0.0.0.0, mandatory
hostname = "random-pc" ; optional
netmask = 255.255.255.0 ; mandatory if not using DHCP
domain_list = your.domain.com ; mandatory if not using DHCP
domain_to = 0 ; optional
sockdelay = 30 ; optional
inactive = 0 ; optional
datatimeout = 120 ; optional
debug = 0 ; optional
mss = 1460 ; optional
mtu = 1500 ; optional
mtu_disc = 0 ; optional
icmp_mask_req = 0 ; optional
language = en,$(ETC)\watlang.txt
hosts = $(ETC)\hosts
services = $(ETC)\services
protocols = $(ETC)\protocol
debug.file = wattcp.dbg ; optional

debug.filter = none
debug.proto = arp/rarp/ip/udp/tcp/icmp

debug.mode = header
debug.stat = 0
sk_debug.device = wattcp.sk
sk_debug.openmode = w+ ; default
syslog.file = ; optional
syslog.host = ; optional
syslog.port = 514 ; optional
syslog.level = emerg/alert/error ; optional
tftp.boot_file = ; optional
tftp.server = ; optional
tftp.timeout = 8 ; optional
tftp.retry = 5 ; optional
http.proxy = your.http.proxy: ; no default
talk.localuser =
talk.screenmode = autocr,split
talk.colors = 1E,1A,71,71,71
talk.alias = joe:joe@some.domain.com
talk.logfile = $(WATTCP.CFG)\talk\talk.log
talk.message = "%s is busy. Try again later.\n"
snuz.tmpdir = $(TEMP)
snuz.rc = $(ETC)\news\snuz.rc ; list of subscribed groups, etc
snuz.active = $(ETC)\news\active ; list of all groups
snuz.host = news.server.com ; news server ipaddr
snuz.from = joe@some.domain.com ; the user's email-address
snuz.editor = edit.exe ; editor for writing posts
snuz.smtp = "popmail send %H %D %f" ; external sendmail program
smbpd.workgroup = "my-work-group"
smbpd.printer1name = "my-printer-at-lpt1"
smbpd.printer2name = "my-printer-at-lpt2"
smbpd.printer3name = "my-printer-at-lpt3"
smtp.subdir = $(ETC)\smtpd\mail\ ; sub-dir for mail/temp files, must exist
smtp.sessions = 8 ; # of SMTP sessions

I once put the C program and the library generated by wattcp into one project, put this wattcp.cfg in the same folder as the project, ran it, and as a result the screen stopped at "Waterloo TCP/IP setup" and wouldn't move.
Floor13 秋蝉 Posted 2003-10-14 00:00
初级用户 Posts 19 Credits 152
Downloaded wat2001b.zip from the official website www.wattcp.com
The tcp.cfg configuration isn't that complicated, just these two lines are enough
my_ip=129.97.50.196
netmask=255.255.255.0
You need make before it can connect
Looks like there is still a difference in the source. If convenient, email me your source, and we can all study it together.
Floor14 forzhanghua Posted 2003-10-14 00:00
初级用户 Posts 21 Credits 169
My wattcp wasn't downloaded from its official website, there were three archive files in total. But I already don't remember where I downloaded it from. I've now successfully configured it with wattcp.cfg. It's just that compared with the tcp.cfg you used, I had to set hostname, domainlist, and gateway as well. I want to ask you, do you have wattcp development documentation? If you do, please send me a copy. My email: forzhanghua@sohu.com
Thanks!
Floor15 秋蝉 Posted 2003-10-16 00:00
初级用户 Posts 19 Credits 152
Did you receive it?
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023