127.0.0.1 Vs. IP Address (Networking Base)

Rather quick question JGO, might be stoopid lol.

Say if I go on about creating a Networking base (Server handles multiple clients).

Basically what I’m asking is, if I program a Networking base only using localhost for testing (127.0.0.1), will everything function the same if I were to host the server on a dedicated server? (Real IP Address)

Reason for this post is I can’t host on my computer :confused: firewall’s all funky + I use to go on file hunts resulting in tons of viruses :S

Looking forward to feedback thanks JGO.

I think so… as long as you configure everything correctly

::slight_smile:
Everything works as long as you configure everything correctly

exactly

Thanks for the feedback :smiley:
Just figured I’d ask due to the fact that I haven’t programmed my own server/client pair and actually tested it online.

It would be disappointing to program a nice networking base than go to distribute it and have it not work online lolz.

Anyone familiar with a free hosting service?
I can’t get no-ip to work due to the fact that I’d have to host it on my computer (Bad firewall >:()

Something that would allow me to upload my server to and host it from there? ::slight_smile:

Did you just say free??? if such a service exists I would like to know too…

For 3$ / month try http://123systems.net/vps.html

3$ is almost less than a coffee at a coffee shop. Good price to try out and play around with networking stuff.

Well, I’m not working at the moment lol. :emo:
Last game I hosted I cashed out at around 450$ - 600$ (Monthly fees for VPS 30$ + Website 10$).

I wouldn’t want to host a game on a ‘paid’ server unless I knew I’d be able to make income.
3$ Though, that’s the cheapest VPS I’ve ever seen :o, I’ll definitely keep it bookmarked.

EDIT: It’s a Linux VPS o.O I’ve only used RAM VPS’s.

I host my servers and games AND my website on my 3$ VPS. :V

What’s a RAM VPS?

I’d presume not, but I’ll ask anyways :P.
For your 3$ VPS is it using ‘putty’ or Remote Desktop Protocol?

Yeah of course, why waste bandwidth with useless stuff like Remote Desktop ^^

Follow this guide:

No, you can’t just bind it to 127.0.0.1 and expect it to work for everyone in the world. You’ll have to bind to the machine’s IP(ipconfig or ifconfig depending on windows / linux) or you use 0.0.0.0 which binds to all addresses available. Then for the client, you connect to the external network IP.

Lolz Agro, they’re all the same I thought. :expressionless:


clientSocket = new Socket("127.0.0.1", clientPort); // #1
clientSocket = new Socket("0.0.0.0", clientPort); // #2
clientSocket = new Socket("localhost", clientPort); // #3

Maybe you misread :).
I asked, if I were to program a basic client/server pair and do all the testing for it only on ‘127.0.0.1’, would it work the same if I were to host the server on a ‘VPS’?

The VPS’s IP would be the ‘external network IP’.
(Which the client connects to)

Oh, I skim through threads only. :slight_smile:

Yeah, but only #2 of those three you listed will work globally.

I’ve never even heard of connecting to 0.0.0.0 :emo:
Only time I’ve seen those numbers relating to networking was in a logging statement:
‘Server connected to 43594/0.0.0.0’.

127.0.0.1 is localhost and always refers to a “loopback” interface that never leaves the host. Actually any 127.x.x.x address is loopback, though some OS’s don’t put the loopback adapter on anything on 127.0.0.1

0.0.0.0 means “any address”, which is implied to mean “any network interface on this node”. When listening, it’s well defined to mean mean “listen on all interfaces”, and is what you want for a public-facing server anyone can connect to. Connecting to 0.0.0.0 is not well-defined at all: some OS’s will connect to localhost, some will connect to the first non-localhost IP, some don’t even allow it at all.

I have a server on 123systems, i only had 1 problem with it, it started to go slow, taking like 5 mins or and up not having to restart putty to log into the VPS, soon enough the server which my VPS was hosted on crashed… not long after they offered new servers to all effected people. and the server has worked 1000 times better then before it crashed lol :slight_smile: I also went for a bit dearer server, and if you look around you can find coupon codes to reduce the price by around 40%, so my better server only costed like $3.50 or $4 or something a month :slight_smile: