
Signature
HTH,
Kevin Spencer
Microsoft MVP
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
[CUT]
Hello Kevin and thanx for answering,
I actually use Socket.Bind in order to bind to a specific network card on
the machine, we had problems when in the past where more than a network card
existed on the machine. I did get same samples browsing in MSDN for VS.2003
looking at MulticastOption class.
The problem on that particular x64 machine is that I get the error very
seldom and for a limited amount of time (some minutes) looks like it's a NIC
driver issue (or perhaps x64 issue?), as we have the same service installed
100+ times and behaving well (all on 32bit machines, tho).
Anyway, here is the complete routine I use to send UDP datagrams, maybe u
can have a look at it and give me some clues.
TIA
Paolo
Public Shared Function Send(ByVal LocalAddress As IPAddress, ByVal
LocalPort As Integer, ByVal GroupAddress As IPAddress, ByVal GroupPort As
Integer, ByVal ttl As Integer, ByVal message As String) As Boolean
Dim UdpSender As Socket
Dim groupEP As IPEndPoint
Dim bytes As Byte()
Try
UdpSender = New Socket(AddressFamily.InterNetwork, SocketType.Dgram,
ProtocolType.Udp)
UdpSender.Bind(New IPEndPoint(LocalAddress, LocalPort))
UdpSender.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.AddMembership, New MulticastOption(GroupAddress,
LocalAddress))
UdpSender.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.MulticastInterface, LocalAddress.GetAddressBytes)
UdpSender.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.MulticastTimeToLive, ttl)
groupEP = New IPEndPoint(GroupAddress, GroupPort)
bytes = Encoding.ASCII.GetBytes(message)
UdpSender.SendTo(bytes, bytes.Length, SocketFlags.None, groupEP)
Return True
Catch ex As Exception
Return False
Finally
If (Not UdpSender Is Nothing) Then
UdpSender.Close()
UdpSender = Nothing
End If
groupEP = Nothing
End Try
> Hi Paolo,
>
[quoted text clipped - 28 lines]
>> TIA
>> Paolo
Kevin Spencer - 26 Sep 2007 13:44 GMT
Hi Paolo,
It does sound like it may be related to the X64 system or drivers. The
64-bit systems are relatively new, and more likely to have some problems.
One possible solution might be to do a couple of retries, with a pause
between each one, before throwing an exception, as networking issues can
tend to be intermittent and resolve themselves. In any case, from what
you're reporting, it sounds like the case here.

Signature
HTH,
Kevin Spencer
Microsoft MVP
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
> [CUT]
>
[quoted text clipped - 86 lines]
>>> TIA
>>> Paolo
QDL - 27 Sep 2007 08:00 GMT
Hello Kevin and again thanx for the answer,
[CUT]
> One possible solution might be to do a couple of retries, with a pause
> between each one, before throwing an exception, as networking issues can
> tend to be intermittent and resolve themselves
[CUT]
I did introduce a solution similar to that, I changed the way the sending
thread uses the SendUDP routine, after an error the message is discarded and
will be sent again later, as it is not very important for the whole
application.
Thanx
Paolo