M
mBird
I wrote a service that listens for broadcast messages from my firewall (UDP
snmp trap messages) and parses and puts the data in an database.
I'd also like to write an app that is a simple form that can listen in when
it runs (so I can see messages in a form as they occur.)
So I need the ability to listen to a UDP port with two apps at the same time
(the service and my app). But when I do that I get an error:
System.Net.Sockets.SocketException: Only one usage of each socket address
(protocol/network address/port) is normally permitted
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at UdpReceive.Class1.StartReceiveFrom() in
c:\myprojects\dotnet\cs\networking
Is it possible to listen to the same port with two apps at once?
Thank you
p.s. One way I could do this is to use a packet driver and something like
WinPCap and just grab the frames from any app I have -- but I'd like to try
this strictly from the DotNet Framework and C#.
snmp trap messages) and parses and puts the data in an database.
I'd also like to write an app that is a simple form that can listen in when
it runs (so I can see messages in a form as they occur.)
So I need the ability to listen to a UDP port with two apps at the same time
(the service and my app). But when I do that I get an error:
System.Net.Sockets.SocketException: Only one usage of each socket address
(protocol/network address/port) is normally permitted
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at UdpReceive.Class1.StartReceiveFrom() in
c:\myprojects\dotnet\cs\networking
Is it possible to listen to the same port with two apps at once?
Thank you
p.s. One way I could do this is to use a packet driver and something like
WinPCap and just grab the frames from any app I have -- but I'd like to try
this strictly from the DotNet Framework and C#.