Client receives ERROR_SOCKET_COMMUNICATION when using the Protection Engine Java API
search cancel

Client receives ERROR_SOCKET_COMMUNICATION when using the Protection Engine Java API

book

Article ID: 152414

calendar_today

Updated On:

Products

Scan Engine

Issue/Introduction

Why does the client/connector receive the exception ERROR_SOCKET_COMMUNICATION or ERROR_INPUT_STREAM_OPEN when scanning files that take several seconds to scan when using the Symantec Protection Engine (SPE) Java API?

Symptoms
The client/connector using our Java API receives ERROR_SOCKET_COMMUNICATION or ERROR_INPUT_STREAM_OPEN for scan requests sent to SPE.

 

Cause

The ERROR_SOCKET_COMMUNICATION or ERROR_INPUT_STREAM_OPEN error can be thrown if the SPE Java API is not able to open a connection with SPE. It can also be caused if the API runs into the readWriteTime timeout that is set in the createScanEngine method of the Java API. By default this parameter is set to 3 seconds. To confirm that the readWriteTime parameter is being reached, check the SPE log files with Verbose logging configured. Then confirm that one the file is being scanned even though the API is throwing the ERROR_SOCKET_COMMUNICATION error, and second in the log file also check how long it took SPE to scan the file.

Resolution

The readWriteTime parameter is set in the Java API createScanEngine method. To increase this parameter, go to the client/connector that is using the Symantec Scan Engine Java API and find the location were the createScanEngine method is being called. If the readWriteTime and failRetryTime are not set it uses the default which is 3 seconds for readWriteTime and 1 second for failRetryTime, the time is in milliseconds. Here is an example of setting the readWriteTime to 60 seconds, and the failRetryTime to 10 seconds:



“ScanEngine scanEngine = ScanEngine.createScanEngine(scanEnginesForScanning, 60000, 10000);”

If the readWriteTime timeout is not the issue, confirm that SPE is up and listening on port 1344 and that the client/connector can reach the server that SPE is running on.

Additional Information

See the following article for instructions on enabling Verbose logging:
https://knowledge.broadcom.com/external/article?articleId=159007

Technical Information
Please contact Support for more information.