Dart.Snmp Namespace : InformMessage Class |
<SerializableAttribute()> Public Class InformMessage Inherits RequestMessage
Dim instance As InformMessage
[Serializable()] public class InformMessage : RequestMessage
[Serializable()] public __gc class InformMessage : public RequestMessage
[Serializable()] public ref class InformMessage : public RequestMessage
This message is used to send variables from an agent or manager to a manager. A ResponseMessage containing the same variables is used to acknowledge the receipt of the information.
Serializable using BinaryFormatter and XmlSerializer.
private void button1_Click(object sender, EventArgs e) { //Send an inform request on a worker thread manager1.Start(sendInform, null); } private void sendInform(SnmpSocket managerSocket, object state) { //Create an inform message and send it to a manager InformMessage inform = new InformMessage(); //The inform includes this manager's uptime inform.Variables.Add(manager1.Mib.CreateVariable(NodeName.sysUpTime, manager1.Security.AuthoritativeEngine.Time.ToString())); manager1.Marshal(new ResponseMessage[] { managerSocket.GetResponse(inform, remoteManagerAddress) }, "", null); } void manager1_Message(object sender, MessageEventArgs e) { label1.Text = "Manager received response to inform:\r\n" + ((ResponseMessage)e.Messages[0]).Variables[0].Value.ToString(); }
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) 'Send an inform request on a worker thread manager1.Start(AddressOf sendInform, Nothing) End Sub Private Sub sendInform(ByVal managerSocket As SnmpSocket, ByVal state As Object) 'Create an inform message and send it to a manager Dim inform As New InformMessage() 'The inform includes this manager's uptime inform.Variables.Add(manager1.Mib.CreateVariable(NodeName.sysUpTime, manager1.Security.AuthoritativeEngine.Time.ToString())) manager1.Marshal(New ResponseMessage() { managerSocket.GetResponse(inform, remoteManagerAddress) }, "", Nothing) End Sub Private Sub manager1_Message(ByVal sender As Object, ByVal e As MessageEventArgs) label1.Text = "Manager received response to inform:" & vbCrLf & CType(e.Messages(0), ResponseMessage).Variables(0).Value.ToString() End Sub
System.Object
Dart.Snmp.MessageBase
Dart.Snmp.StandardMessage
Dart.Snmp.RequestMessage
Dart.Snmp.InformMessage