You'll need to offer a few more specifics before anyone will be able to assist you...
First, when you say 'clients', do you mean the client originating the request, or the machines being queried for directories/files?
"the clients don't have web server, is a common machine."
Second, what type of file sharing is being used on the machines being queried for directories/files? You could either be referring to a file sharing or ftp architecture...the difference is important. Either way, however, sockets will do the job of enumerating directory/file lists. Look up "fopen" and related commands for doing so.
Third, if you're trying to scan a local network, I would use a simple "for" statement to build a list of ip addresses and scan each one for a particular port(s).
Like I said, the more information that is offered, the more information you will receive.