[libsmbclient] Windows XP 10 connection limit

Scott Lovenberg scott.lovenberg at gmail.com
Mon Oct 6 20:57:47 GMT 2008

ZeWaren / Erwan Martin wrote:
> Hi,
> I'm building a small script that scans my local network and lists the 
> files located on it.
> I'm using libsmbclient to get the list of shares on each computer.
> However, when I scan windows XP computers, I can only open 10 shares 
> on them, then I get some 'access denied' errors. I google that problem 
> and found out that this limit is normal, ie you can only open 10 
> connections to a windows xp computer.
> Since I only open one share at a time, why am I facing that limit?
> I'm using these three functions:
> smbc_init
> smbc_opendir
> smbc_readdir
> smbc_closedir
> Is there a way for samba not to open a new connection for each share?
> Or is there a way to close a connection manually?
> Thanks in advance.
> Erwan Martin, French student.
Yeah.  That's an ugly one; I've hit it as well.  So far as I could tell, 
Windows counts a channel as a connection.  I think you can try 
connecting as a different user (establish another channel), but IIRC, I 
couldn't find a way around it.  No registry hacks, no third party 
solutions, it seems to be a hard limit.  However, when you disconnect a 
user that connection becomes open again in about a second or three. 

I'm wondering if you could trick windows by using some kind of 
encapsulation/spoofing and effectively carry out two connections within 
a single connection.  If even possible, you'd have to multiplex and 
demux (right word?) the connection on your client end - probably more 
trouble than its worth, IMHO.

More information about the samba-technical mailing list