Results 1 to 6 of 6
  1. #1
    madhumurundi is offline Member
    Join Date
    Apr 2008
    Posts
    2
    Rep Power
    0

    Post How To Make Socket Connection

    hello, frndz i prepared code for socketprogramming ...its working in stand alone system but it is not working across the network...it is showing an exception.....socket is not creating..........i mentioned int port=6789; and hostname=localhost; so wt can i do???????????????????:

  2. #2
    Java Tip's Avatar
    Java Tip is offline Moderator
    Join Date
    Nov 2007
    Posts
    1,694
    Blog Entries
    430
    Rep Power
    9

    Default

    What is the exception? May be that port is being used by another application on the system you are trying to test networking.
    "The sole cause of manís unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal

  3. #3
    dream_noir is offline Member
    Join Date
    Apr 2008
    Posts
    4
    Rep Power
    0

    Default

    If the hostname your using is localhost then you aren't connecting across a network, you are trying to connect to the computer you're currently on. More information would be good, but if you don't have the client/server both running on your local computer and your trying to connect to localhost then well, it just won't work.

  4. #4
    madhumurundi is offline Member
    Join Date
    Apr 2008
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by dream_noir View Post
    If the hostname your using is localhost then you aren't connecting across a network, you are trying to connect to the computer you're currently on. More information would be good, but if you don't have the client/server both running on your local computer and your trying to connect to localhost then well, it just won't work.
    while i connecting in across the network i changed localhost name to hostname of that machine....even though its not working..????

  5. #5
    dream_noir is offline Member
    Join Date
    Apr 2008
    Posts
    4
    Rep Power
    0

    Default

    What do you mean you changed localhost to the host name of the machine? Do you mean the IP address of the machine? You're probably going to need to post up some information about what you're trying to do and exactly how you're trying to do it.

    What is the address of the remote machine your trying to connect to and on what port. Is it in the same network as you? Is the remote machine running a firewall? Things like that.

  6. #6
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    Quote Originally Posted by dream_noir View Post
    What do you mean you changed localhost to the host name of the machine? Do you mean the IP address of the machine? You're probably going to need to post up some information about what you're trying to do and exactly how you're trying to do it.

    What is the address of the remote machine your trying to connect to and on what port. Is it in the same network as you? Is the remote machine running a firewall? Things like that.
    madhum, please do as advised by dream_noir... some code would also help too... you're prolonging the answer to your question by leaving out crucial information.
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

Similar Threads

  1. Replies: 3
    Last Post: 04-13-2010, 03:43 PM
  2. Socket
    By vortex in forum New To Java
    Replies: 2
    Last Post: 05-25-2008, 06:41 AM
  3. XML through a socket
    By Heather in forum XML
    Replies: 2
    Last Post: 07-04-2007, 09:31 AM
  4. send files through socket
    By bbq in forum Advanced Java
    Replies: 1
    Last Post: 06-05-2007, 02:08 AM
  5. How to make a HTTP connection to a website
    By Alayna in forum Networking
    Replies: 1
    Last Post: 05-20-2007, 11:58 AM

Posting Permissions

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