Simulating a network on one machine

Started by
6 comments, last by Michalson 24 years, 1 month ago
I''m interested in developing some multiplayer software, and I''ve already created a simple chatroom in DirectPlay. My problem comes in testing. If I''m connected to the net or on a network I can created two instances of my chatroom on one computer and connect them to each other. However, without the network connect they cannot detect each other. Is there anyway I can configure my system to believe it''s on a network (?make multiple ips?make a program to bounce back packets?). Any suggestions would be appreciated.
Advertisement
I dont know what to do about having only one system, but if you have two systems you might consider getting a serial cable and using the Direct Cable Connection program that came with windows. It simulates a network, and I found it pretty useful before I actually put in a real network.

--TheGoop

Edited by - TheGoop on 3/3/00 4:50:15 PM
The only way I can think of configuring a single computer like that is to put two network cards in and bind them to different IP addresses and link them to each other. Obviously it''s a lot easier to just get two separate computers than to deal with that kind of weirdness.

Possibly you can write a device driver to emulate a network interface and pass events over loopback to other instances of itself, but that is probably outside the scope you''re considering.
I do all my testing on just one machine. You know the address you want to connect to: 127.0.0.1 is the IP address, and the port is whichever port your program allocates.

Provided each instance of your program allocates a unique port (and can determine the other instance''s port) you should be right. (I''ve never tried running two instances of a program that allocates a set port so I don''t know what would happen, but I imagine the second instance would fail?).

You mentioned DPlay in a peripheral sense, so I''ll just add that I know nothing about it.

-Hotstone
Hotstone: Directplay binds on interfaces rather than TCP/UDP ports, so you can''t use the normal IP loopback address for debug effectively. Oh and two sockets attempting to bind on the same port *will* cause the second call to fail.
Well, at the moment I can do some limited testing with my p120 laptop hooked up to LPT1, but eventually my laptops lack of a 3D accelerator will render testing impossible. If anyone else has any ideas I would still be interested.
The ideal way to test you software is with the actual hardware, i.e. two computers hooked up together, if you cannot afford this expense, then look at asking a few people to help you out with testing it.
Although you baffel me, why, having (as you have said) been able to make it work on a network, do you want to try running it twice on your own computer?
Oh well, the worlds a strange place.
And while we''re at it, I have 2 test machines here with all the kit, so if you are desperate I''ll test it for you if you sent it to me.

Take it easy, they''re only suggestions

-Mezz
I debug my DirectPlay apps on the same computer, but I only use IPX, because that works fine on the same computer, but if you want to test performance/lag and more advanced stuff, you should let someone else test it.
============================Daniel Netz, Sentinel Design"I'm not stupid, I'm from Sweden" - Unknown

This topic is closed to new replies.

Advertisement