Bind exception

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • eeh

    Bind exception

    Hi,

    I got bind exception (Jave.ent.BindE xception: Cannot assign requested
    address: JVM_BIND) when the following statement is executed.

    ss=new ServerSocket(0x 55,0,InetAddres s.getByName("19 2.168.0.8"));

    The host 192.168.0.8 is on and can be pinged.

    Could anyone tell me why?

    When I change the stement to be

    ss=new ServerSocket(0x 55);

    no exception is thrown.

    Thanks!

  • Michael Banzon

    #2
    Re: Bind exception

    eeh wrote:[color=blue]
    > The host 192.168.0.8 is on and can be pinged.[/color]

    But is it the IP address of the machine that's running the code?? It
    should be...

    --
    Michael Banzon

    Comment

    • eeh

      #3
      Re: Bind exception

      >[color=blue]
      > But is it the IP address of the machine that's running the code?? It
      > should be...
      >[/color]

      Not from the same computer, actually it is a network standalone device.

      Comment

      • Gordon Beaton

        #4
        Re: Bind exception

        On 16 Mar 2005 00:32:49 -0800, eeh wrote:[color=blue][color=green]
        >>
        >> But is it the IP address of the machine that's running the code?? It
        >> should be...
        >>[/color]
        >
        > Not from the same computer, actually it is a network standalone
        > device.[/color]

        If your host doesn't have a network interface with that address, you
        can't do it. A socket (Socket or Serversocket) can only bind to the
        address of one of the host's network interfaces.

        Specifying a portnumber alone works because the address defaults to
        the wildcard address (0.0.0.0), which matches all of the host's
        interfaces.

        What are you trying to do?

        /gordon

        --
        [ do not email me copies of your followups ]
        g o r d o n + n e w s @ b a l d e r 1 3 . s e

        Comment

        • eeh

          #5
          Re: Bind exception

          > If your host doesn't have a network interface with that address, you[color=blue]
          > can't do it. A socket (Socket or Serversocket) can only bind to the
          > address of one of the host's network interfaces.[/color]

          The device does have network interface and the server socket is working

          when no specified IP is given. Pinging to the device is successful.
          [color=blue]
          > What are you trying to do?[/color]

          Actually the device is a parallel ethernet converter.

          Comment

          • eeh

            #6
            Re: Bind exception

            > > If your host doesn't have a network interface with that address,
            you[color=blue][color=green]
            > > can't do it. A socket (Socket or Serversocket) can only bind to the
            > > address of one of the host's network interfaces.[/color][/color]

            OK, I get your meaning. The server socket cannot be applied to a IP
            from a remote host.

            Comment

            Working...