   Network Test on a Single Machine?
  hey,interesting question.  I'm workig on a network app where a server essentailly monitors multiple other machines and polls then periodically for updates.  I'm trying to think of a way to mock test this on a single machine (i've got 4 machines at home but i'd like to mock up something like 1 server & 10-20 remote machines).is there a way to build a dummy client such that it will act like it's on a remote machine?the only idea i've come up with so far is to hack my hosts file and map in an entire network IP block to localhost (like 192.168.2.x).  if i do something like that would a client program asked to listen on 192.168.2.x: Port y interfere with other client programs running on the same machine that are trying to listen on the same port but a different IP addess also mapping to localhost?is there another way to do this?  i could always just have the clients listen on sequential ports but i'd have to include some special case testing code and that might mess up the validity of my tests...thanks-me[edited by - Palidine on February 10, 2004 11:30:38 PM]
  What operating system?Linux:ifconfig eth0 some.ip.address upifconfig eth0:0 some.other.ip.address upifconfig eth0:1 some.other.blah.ipetc. Then just bind the clients to an individual IP.Dunno about other OS's   [edited by - DracosX on February 10, 2004 11:38:28 PM];  sorry, yeah.  it''s a cross platform app.  but right now i''m going to be testing it on a win200 system b/c my freeBSD box has decided that it no longer likes talking to other computers.-me ;  el bumpo ;quote:is there another way to do this? i could always just have the clients listen on sequential ports but i''d have to include some special case testing code and that might mess up the validity of my tests...Why do you have to add special case testing code in order to have the clients sit on the same physical machine (but on different ports)? If you can''t switch around to arbitrary ports, there must be something strange going on with your design.cu,Prefect ;  There shouldn''t be a problem, i have a TCPIP stream socket progam working on my computer such that there is one host, and as many clients as i want, the key thing is that you canonly set up one server to listen on a port for connections.But as many clients as you want should be able to connect to send and recieve on the same port.check out the gametutorials.com multiple host network tutorial;quote:the key thing is that you can only set up one server to listen on a port for connections.... which isn''t really a problem either. After all, you could have multiple servers listening on different ports.cu,Prefect ;  right it''s obvioulsy easy to just have the clients listen on different ports and have the server communicate with different ports.  the deal is that there''s a database aspect to the whole thing where the remote machine info sits in a database that the server reads on startup so that it knows where all of it''s clients are.  they are very very dumb clients and for hardware reasons they can''t be continually calling in to refresh the server''s memory for what port they are listening on.the only reason i say special code is because the listen port is hard-coded (again because it makes things easier for the hardware of the clients).  so to make this testable on a single machine i need to add a port column to the database and make the appropriate (albeit minor) logic changes in the db access layer & whatnot.  it''s just undesirable b/c when i go to the actual setup i''ll end up with an unused column in the database.that''s why i was hoping for a way (like the supplied *nix option) to enable single machine / multiple-ip testing.that said, i''m going to try the hosts file option that i asked about on my windows box tonight.  hopefully it''ll work and this thread will be moot.thanks-me 