I am struggling to implement the INSTREAM command of clamd daemon in Ruby. Here is the document of clamd
@file = File.open("input.txt")
socket = TCPSocket.new(HOST, PORT)
#writing the command
socket.write("zINSTREAM\0")
#streaming the chunk
socket.write(1024) #size of chunk
socket.write(@file.read(1024)) #chunk of data
#end the streaming
socket.write(0)
puts "Reading from the scoket"
puts socket.recv(1024)
socket.close
But I am always receiving the error response "INSTREAM size limit exceeded. ERROR" What I doing wrong here?