Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By bakstar

Thread: Socket

  1. #1
    baggio90 is offline Member
    Join Date
    Sep 2012
    Posts
    3
    Rep Power
    0

    Default Socket

    Hello
    I am new Socket programming and i try to write chat program (client/server)
    and programs shot this Exeption

    Exception Occured: java.net.UnknownHostException
    Why shot i dont know :(

    Socket toServer=new Socket("machine-name",1001);
    Help Please

  2. #2
    bakstar is offline Member
    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0

    Default Re: Socket

    "machine-name" is probably not a real host. You need to have the exact host name or its IP address.

    If your trying to connect to localhost try "127.0.0.1"
    Jire likes this.

  3. #3
    Potato is offline Member
    Join Date
    Dec 2011
    Posts
    25
    Rep Power
    0

    Default Re: Socket

    Try using "\\machine-name"

    Make sure you are on the same network.

Similar Threads

  1. Socket Programming ERROR : Socket not connected
    By vishrut_n_shah in forum Networking
    Replies: 0
    Last Post: 11-04-2011, 09:32 AM
  2. Socket help
    By 80mins in forum New To Java
    Replies: 3
    Last Post: 05-31-2011, 03:08 PM
  3. Replies: 1
    Last Post: 07-02-2010, 01:18 PM
  4. Socket
    By Syahrul in forum New To Java
    Replies: 0
    Last Post: 12-20-2009, 01:31 PM
  5. append response to the request from Socket and write to another socket
    By vaibhav_singh_vs@yahoo.co in forum Networking
    Replies: 3
    Last Post: 04-17-2009, 07:02 PM

Posting Permissions

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