Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4348235

Cannot perform a bind to a Socket with out making a connection to it.

XMLWordPrintable

    • beta
    • x86
    • windows_nt



      Name: jk109818 Date: 06/26/2000


      java version "1.2fcs"
      Classic VM (build JDK-1.2fcs-O, native threads)


      Java Sockets do not allow you to make a bind to a port without having tio
      connect to it, unlike the C++ Socket API which allows you to make Socket binds
      without necessarily making a connection to a socket.

      There is no simple way to bind to a port in JAVA, without having to write a
      whole new implementation of SocketImpl. This is very inflexible, since the
      PlainSocketImpl, that is provided with Java already has two functions "bind"
      and "connect" that could be called seperately from the Socket class. However,
      there are no methods in the Socket class (such as socket.bind() or
      socket.connect()) that allow these methods in PlainSocketImpl to be called. The
      Socket class calls these methods together, thus causing a bind and a connection
      to occur.

      It would be a relatively easy change to include a couple of methods in Socket
      class that allows binds and connections to be performed seperately.
      (Review ID: 106511)
      ======================================================================

            jccollet Jean-Christophe Collet (Inactive)
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: