Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2011
    Posts
    10
    Rep Power
    0

    Default basic Server Networking

    Hello I am new to creating servers and generally networking in Java. I want to discuss the process of how to host a java server on the net. I know that you need more than just simple file hosting but are there any online resources that could shed some light on the subject. My eventual plan is to create a chess game that sends data across the web to two different players. then maybe move onto a more action based game.
    <Daniel>P.</Berry>

  2. #2
    ra4king's Avatar
    ra4king is offline Senior Member
    Join Date
    Apr 2011
    Location
    Atlanta, Georgia, US
    Posts
    396
    Rep Power
    4

    Default

    Look into the java.net, java.nio, and java.nio.channels packages. For tutorials, you can always check out Sun's Java Sockets tutorials.

  3. #3
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default

    What ra4king said. Plus, you also might want to read up on serialization, particularly Object streams. The state of a chess game seems like a prime candidate for the simplicity of Java's serialization mechanism.

    Depending on how your ISP and home/office/school networks are set up, you might be able to host the server yourself. But that's a pretty involved discussion, and pretty off-topic for this forum.
    Get in the habit of using standard Java naming conventions!

  4. #4
    ra4king's Avatar
    ra4king is offline Senior Member
    Join Date
    Apr 2011
    Location
    Atlanta, Georgia, US
    Posts
    396
    Rep Power
    4

    Default

    @kjkrum
    What's important first is that he learns how to use blocking TCP sockets, non-blocking TCP channels, and non-blocking UDP channels. He also needs to learn java.io for blocking sockets and java.nio for non-blocking channels.

  5. #5
    Join Date
    Apr 2011
    Posts
    10
    Rep Power
    0

    Default Not sure

    Thanks for the links but do you know a good free program that would allow me to host a java server online or o n my computer for sending data across the network.
    <Daniel>P.</Berry>

  6. #6
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default

    You don't need any special program to host a Java server on your own computer - just the JRE. The problem is routing connections to it. Again, that depends on how your computer is connected to the Internet. The simplest scenario is if your computer is connected directly to your Internet connection, and has its own public IP address. The most complicated scenario is if your computer is connected to the Internet via a school or corporate network, and has a private (non-routeable) IP address. This tutorial is about Web servers, but the second and third sections sound like they'd be applicable to any type of server.

    Hosting a Java server somewhere else on the Internet would probably require paying for dedicated hosting. Running Java apps isn't a service you're likely to find from a free site, or even a commercial shared hosting site.
    Get in the habit of using standard Java naming conventions!

Similar Threads

  1. New to networking
    By PhQ in forum Networking
    Replies: 7
    Last Post: 07-25-2010, 12:56 AM
  2. Help with Networking
    By mr_anderson in forum Networking
    Replies: 1
    Last Post: 07-11-2010, 10:18 PM
  3. New to Networking
    By Psyclone in forum Networking
    Replies: 1
    Last Post: 03-06-2010, 02:49 AM
  4. Networking
    By Psyclone in forum AWT / Swing
    Replies: 1
    Last Post: 02-26-2010, 05:41 AM
  5. Basic Question from Networking Beginner
    By JDCAce in forum Networking
    Replies: 7
    Last Post: 10-10-2008, 09:29 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •