[jcifs] SmbFile: BindException problem while browsingworkgro ups

Christopher R. Hertel crh at ubiqx.mn.org
Thu Nov 8 16:38:13 EST 2001

Hmmm... The problem *sounds* like a case of SO_REUSEADDR not being used, but
I think SO_REUSEADDR only applies to TCP connections.  Hmmm...

This would only be a problem if:
  1) We're talking about a TCP connection. (Mike: does initial, top-level
     browse list lookup use TCP?  There are some odd gaps in my knowledge,
  2) The same port is being requested for the outgoing connection.
  3) The JVM you are using doesn't set SO_REUSEADDR.
  4) There is an SO_REUSEADDR flag, or equivalent, on your OS.

That's all pretty much a longshot but it sure sounds like symptoms I've
seen when SO_REUSEADDR isn't set.  Basically, the idea of SO_REUSEADDR is
this:  When you close a port the computer at the other end may continue to
send stuff to you for a little while (until it notices you've closed the
port).  That in mind, the OS won't give out the same port again for a few
seconds.  You use SO_REUSEADDR to tell the OS that it's okay to re-use that

Is this making any sense and is there any possibility that it's even related
to the problem you're seeing?

Chris -)-----

"Allen, Michael B (RSCH)" wrote:
> So you run your program once, it works, but if you run it again within a short period of time it fails to bind that address? If so, it sounds like the OS is not releasing the socket from the last run.
> Are you setting any properties like laddr or baddr? Try setting baddr to your broadcast address. Post a -Dlog=ALL if you still haven't figured it out.
> > -----Original Message-----
> > From: Hoppe, Jan 3203 PPW-1 [SMTP:Jan.Hoppe at de.heidelberg.com]
> > Sent: Wednesday, November 07, 2001 9:52 AM
> > To:   'jcifs at lists.samba.org'
> > Subject:      [jcifs] SmbFile: BindException problem while browsing workgroups
> >
> > I'm not able to list the workgroups in my network twice (empty smb-URL in
> > SmbFile constructor: SmbFile smbFile = new SmbFile("smb://"))
> > But after creating a new smbFile with a workgroup name in it's constructor
> > it works fine! I'm really confused.
> >

Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org

More information about the jcifs mailing list