| Dart.PowerSNMP Namespace > Agent Class > Send Method : Send(Message,String) Method |
Send a message to the SNMP manager specified.
[Visual Basic]
Overloads Public Function Send( _
ByVal message As Message, _
ByVal remoteHost As String _
) As Integer[C#]
public int Send(
Message message,
string remoteHost
);[C++]
public: int Send(
Message* message,
string* remoteHost
) [C++/CLI]
public:
int Send(
Message^ message,
String^ remoteHost
) | Exception | Description |
|---|---|
| SocketException | A problem was experienced using network resources. |
| InvalidOperationException | The provided message parameter is not a ResponseMessage, Report Message, TrapMessage, or NotifyMessage |
The following example demonstrates sending a trap message with the Agent component.
[Visual Basic]
Try
'Create Trap Message
Dim trap As TrapMessage = New Dart.PowerSNMP.Trap.warmStart
Agent1.Send(trap, "Dart-IBM-Host")
Catch ex As Exception
ShowError(ex.Message)
End Try
[C#]
try
{
// Create and Send a Trap Message
TrapMessage trap = new Dart.PowerSNMP.Trap.warmStart();
agent1.Send(trap, "Dart-IBM-Host");
}
catch (Exception ex)
{
ShowError(ex.Message);
}
Platforms: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP, Windows Server 2003, Windows Vista
Agent Class | Agent Members | Overload List
Send comments on this topic.
Documentation version 1.2.0.0.
© 2008 Dart Communications. All rights reserved.