[jcifs] SmbFile: BindException problem whilebrowsingworkgro ups

Christopher R. Hertel crh at ubiqx.mn.org
Thu Nov 8 17:34:02 EST 2001

Yeah, your arguments all make sense.  Still, the symptoms fit.  Urq.  I
can only imagine that the JVM implementation is doing something like caching
the free port number...but that doesn't make sense either because some other
OS process could allocate or free ports as well, thus invalidating any


Still, the symptoms suggest...

Ah, it's late.  There's every chance I'm not thinking clearly (not that this
is unusual).  :)

Chris -)-----

"Allen, Michael B (RSCH)" wrote:
> > -----Original Message-----
> > From: Christopher R. Hertel [SMTP:crh at ubiqx.mn.org]
> >
> > Hmmm... The problem *sounds* like a case of SO_REUSEADDR not being used, but
> > I think SO_REUSEADDR only applies to TCP connections.  Hmmm...
> >
> Yes, I'm familiar with this and the nature of the Exception made me think of it immediately. However it suggests the client is trying to reuse the same local port which could only be provoked by the
> jcifs.smb.client.lport property which admittedly I have never used and I doubt Jan is either.
> > 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,
> >      yes.)
> >
>         Yes, it opens a TCP connection to IPC$ of the LMB.
> >   2) The same port is being requested for the outgoing connection.
> >
>         It shouldn't. The client opens the socket on port 0 by default which means any available port.
> >   3) The JVM you are using doesn't set SO_REUSEADDR.
> >
>         I doubt it but I don't really know. I would think it would. I think the only issue with not using this socket option is a minor degradation in performace. I would think they would use it to
> avoid the confusion it would cause.
> >   4) There is an SO_REUSEADDR flag, or equivalent, on your OS.
> >
>         I think most OS's that support Java at this point use BSD style sockets. Maybe MAC < 10 is different. Donno.
> > That's all pretty much a longshot but it sure sounds like symptoms I've
> > seen when SO_REUSEADDR isn't set.
> >
>         True. But I don't think it's the problem because unless he's using the lport property. A -Dlog=ALL trace would really narrow it down.
>         Mike

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