Hi Jim,
Did you mean that the code worked normally but your hardware could not
receive the data or the code failed working on Vista?
I performend a test on both Windows XP and Windows Vista and everything
worked fine. My test code is as following:
============================================
Console.WriteLine("Set send times: ");
Console.WriteLine("Set send times: ");
string strCount = Console.ReadLine();
try
{
UdpClient client = new UdpClient();
int nPort = 15000;
IPEndPoint ep = new IPEndPoint(IPAddress.Broadcast,
nPort);
byte[] bytes =
System.Text.ASCIIEncoding.ASCII.GetBytes("HELLO.\0");
for (int i = 0; i < int.Parse(strCount); ++i)
{
int nSent = client.Send(bytes, bytes.Length, ep);
System.Threading.Thread.Sleep(1000);
Console.WriteLine("TIME:" +
DateTime.Now.ToString("HH:mm:ss.fff") + " SENT: Hello check has been
sent!");
}
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
================================================
I run the test code on Vista for sending 100 times and then I used Network
Monitor 3.0 to monitor the network traffic by filtering IPv4.SourceAddress
== xxx.xxx.xxx.xxx on my Windows XP machine, and I found that all the
packets were captured by NetMon.
Your code seemed fine. I recommend that you check your network conditions
to see if your Vista machine can access the target hardware. If the
physical connection could not established, your hardware could not receive
the packets at all. You may also use Network Monitor to see if you can
receive the packets on another machine.
Hope this helps. If you have any other questions or concerns, please feel
free to let me know.
Have a good day!
Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications
If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx. ======================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================