This is what I have in my clamd.conf on unix machine # Path to a local socket file the daemon will listen on. # Default: disabled (must be specified by a user) LocalSocket /tmp/clamd.socket
# Remove stale socket after unclean shutdown. # Default: yes #FixStaleSocket yes # TCP port address. # Default: no #TCPSocket 3310 # TCP address. # By default we bind to INADDR_ANY, probably not wise. # Enable the following to provide some degree of protection # from the outside world. # Default: no #TCPAddr 127.0.0.1 # Maximum length the queue of pending connections may grow to. # Default: 15 #MaxConnectionQueueLength 30 Should I uncomment the line TCPSocket 3310. Is there any thing that admin has to do for the port number to be active. Also do I need to comment the line "LocalSocket /tmp/clamd.socket". Is using the api right way to invoke the clamav Thanks for help Madhuri ________________________________ From: Török Edwin <[email protected]> To: ClamAV users ML <[email protected]> Sent: Thursday, February 5, 2009 10:11:15 AM Subject: Re: [Clamav-users] New to Clamav On 2009-02-05 17:07, Madhuri Somavarapu wrote: > I installed ClamAV both on my Windows and Unix machine. Here is the sample > code I am using from Java > > public boolean fileFactoryScanner (String destFilePath) throws Exception { > ClamAVScannerFactory.setClamdHost("127.0.0.1"); > ClamAVScannerFactory.setClamdPort(3310); > ClamAVScanner scanner = ClamAVScannerFactory.getScanner(); > DfLogger.info(com.vzwcorp.sics.clam.FileScanner.class, "Scanning File: > " + destFilePath, null, null); > InputStream inputStream = new FileInputStream(destFilePath); > boolean resScan=false; > if(inputStream!=null){ > resScan = scanner.performScan(inputStream); > }else{ > Logger.info("There is no Input stream"); > } > return resScan; > } > > Is this the right way to do it? > > It works on windows with response true or false. On unix it doesn't > > It gives me Scannerexception: Error while requesting protocol channel. > > Can anybody help him with this? What needs to be changed in clamd.conf that > can make the above code work on port 3310 > Did you set TCPSocket in clamd.conf? --Edwin _______________________________________________ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://www.clamav.net/support/ml _______________________________________________ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://www.clamav.net/support/ml
