Jump to content
  • Advertisement
Sign in to follow this  

Using one pc

This topic is 4213 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Yes you can.
It's a loopback connection. If your server for examples listen on port 1234 just connect your client to this port with the ip 127.0.0.1

Share this post


Link to post
Share on other sites
Ok so I have a client and server set up on my computer and they can talk to each other. Now if I want multiple clients on my server, should I just let one connect, send them what they want, and then listen for a second client?

Share this post


Link to post
Share on other sites
You can also start more than one client on your pc if its fast enought. Of course this technique is not representative, because a loopback connection does not have problems like latency and package lost. I think it is only good for debugging purposes. If you want to test your server you should run it on a different pc in a different network with real operating conditions.

Share this post


Link to post
Share on other sites
I have a question regarding this so I just throw it in here:
What if I want to create the similar latency issues that occur on the net as I want to try my interpolations in a normal environment.
Can I send it out and back again on the net somehow?

Share this post


Link to post
Share on other sites
simply lag out your data sending. Put a counter and only send every 2-5 seconds randomly and see if it breaks your code. Also if you want to test data loss, though I'm not sure how effective it is, just set your server and client up to randomly not send packets.

Share this post


Link to post
Share on other sites
You could also write a proxy program that sat in the middle, between the two programs. So, your clients would connect to the proxy instead of to the server, and the proxy would be configured to forward packets to the server. The proxy would add some lag, a certain amount of spikiness, flip some ordering about, drop a few packets, and generally make things nasty.

But that's a bit of effort. Easier to just have the sender send things a bit late.

Share this post


Link to post
Share on other sites



Use IP 127.0.0.1 and different ports for each program.

Ive run 4 different programs talking between themselves on the same
machine (multiple clients and a server).

Make sure that you have a tight service loop (dont have the programs do too much between checking the network).

Share this post


Link to post
Share on other sites
I don't know if this is a better way to test this, but I've always used Microsoft's Virtual Server to set up a test environment. It will get a unique IP address (if using DHCP) and then you'll know that your program runs on a bare installation of Windows or Linux.

The bad part is, you should have a reasonable amount of RAM.
The good part is, it's free!

Microsoft's Virtual Server

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!