Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  127.0.0.1 Vs. IP Address (Networking Base)  (Read 1816 times)
0 Members and 1 Guest are viewing this topic.
Offline GabrielBailey74
« Posted 2013-02-06 21:48:45 »

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 :/ firewall's all funky + I use to go on file hunts resulting in tons of viruses :S

Looking forward to feedback thanks JGO.

Offline wreed12345

JGO Knight


Medals: 24
Projects: 2
Exp: 2 years


http://linebylinecoding.blogspot.com/


« Reply #1 - Posted 2013-02-06 21:52:30 »

I think so... as long as you configure everything correctly

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 133
Projects: 4
Exp: 3 years



« Reply #2 - Posted 2013-02-06 21:54:36 »

I think so... as long as you configure everything correctly
Roll Eyes
Everything works as long as you configure everything correctly
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline wreed12345

JGO Knight


Medals: 24
Projects: 2
Exp: 2 years


http://linebylinecoding.blogspot.com/


« Reply #3 - Posted 2013-02-06 21:56:35 »

exactly

Offline GabrielBailey74
« Reply #4 - Posted 2013-02-06 21:57:09 »

Thanks for the feedback Cheesy
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.

Offline GabrielBailey74
« Reply #5 - Posted 2013-02-06 21:59:14 »

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 Angry)

Something that would allow me to upload my server to and host it from there? Roll Eyes

Offline wreed12345

JGO Knight


Medals: 24
Projects: 2
Exp: 2 years


http://linebylinecoding.blogspot.com/


« Reply #6 - Posted 2013-02-06 22:00:20 »

Did you just say freeHuh if such a service exists I would like to know too...

Offline jonjava
« Reply #7 - Posted 2013-02-06 22:24:06 »

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.

Offline GabrielBailey74
« Reply #8 - Posted 2013-02-06 22:34:42 »

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 Shocked, I'll definitely keep it bookmarked.

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

Offline jonjava
« Reply #9 - Posted 2013-02-06 22:37:25 »

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

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline jonjava
« Reply #10 - Posted 2013-02-06 22:38:26 »

What's a RAM VPS?

Offline GabrielBailey74
« Reply #11 - Posted 2013-02-06 22:45:59 »

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

Offline jonjava
« Reply #12 - Posted 2013-02-06 22:49:53 »

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

Follow this guide:
http://www.youtube.com/watch?v=h4lwjUjtfHQ

Offline Agro
« Reply #13 - Posted 2013-02-07 03:45:26 »

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.

Offline GabrielBailey74
« Reply #14 - Posted 2013-02-07 04:03:37 »

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. Stare
1  
2  
3  
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 Smiley.
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)

Offline Agro
« Reply #15 - Posted 2013-02-07 04:05:37 »

Oh, I skim through threads only. Smiley

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

Offline GabrielBailey74
« Reply #16 - Posted 2013-02-07 04:07:36 »

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'.

Offline sproingie

JGO Kernel


Medals: 202



« Reply #17 - Posted 2013-02-07 05:16:12 »

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.
Offline Phased
« Reply #18 - Posted 2013-02-07 05:49:44 »

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 Smiley 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 Smiley
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (20 views)
2014-09-24 16:12:06

Grunnt (45 views)
2014-09-23 14:38:19

radar3301 (28 views)
2014-09-21 23:33:17

BurntPizza (64 views)
2014-09-21 02:42:18

BurntPizza (34 views)
2014-09-21 01:30:30

moogie (42 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!