this is my code use QuickSend method to get sysDesc is OK but with Symbol Rate it always fail. I don't know, the same code actually works in another project I wrote before (I run it again and everything is fine).
var
mySNMP: TidSNMP;
SymbolRate, sysDesc: string;
begin
mySNMP:=TidSNMP.Create(nil);
try
mySNMP.Host:=Trim(IpEdit.Text);
mySNMP.Community:=Trim(CommEdit.Text);
mySNMP.ReceiveTimeout:=1000;
if mySNMP.QuickSend('1.3.6.1.2.1.1.1.0', mySNMP.Community, mySNMP.Host, sysDesc)
then
ShowMessage(sysDesc)
else
ShowMessage('Send Failed');
if mySNMP.QuickSend('.1.3.6.1.4.1.6247.24.1.2.2.12.0',mySNMP.Community, mySNMP.Host,SymbolRate)
then
ShowMessage('Send OK')
else
ShowMessage('Send Failed');
finally
mySNMP.Free;
end;
QuickSend()
(and SendQuery()
in general) returns False if:
the socket is reset (it reports error code 10054, WSAECONNRESET
).
no response is received within the specified timeout.
the response cannot be parsed.
the response is parsed by contains an error code from the server (see the Reply.ErrorStatus
property).
The first thing I would suggest is for you to remove the leading .
from the failing OID:
if mySNMP.QuickSend('1.3.6.1.4.1.6247.24.1.2.2.12.0',mySNMP.Community, mySNMP.Host,SymbolRate)
That way, it matches the query code in your earlier question, which was working:
SNMP.QuickSend('1.3.6.1.4.1.6247.24.1.2.2.12.0',SNMP.Community,SNMP.Host,SRate);