[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Simple UDP chat app not working !!!

Allan McLemore

1/1/2003 10:29:00 PM

Posted at: dotnet.framework.windowsforms

http://communities.microsoft.com/newsgroups/previ...
p?
ICP=dotnet&sLCID=us&sgroupURL=microsoft.public.dotnet.frame
work.windowsforms&sMessageID=%253C003001c2b0fe%
2524063f03d0%2524d7f82ecf@TK2MSFTNGXA14%253E

Thank you,
Steve.


1 Answer

(garygumsft)

1/2/2003 8:27:00 AM

0

Hi Steve,

There is an error occurring in the Listen method. The error cannot be
captured by the main thread. Instead, you should use the
try...catch to capture the error. Fo rexample,

try
{
while (this.isChatting)
{

// Tried listening to everyone and still no luck !!!
System.Net.IPEndPoint ipEndPoint = new
System.Net.IPEndPoint(System.Net.IPAddress.Any, 0);
System.Byte[] receiveBytes = this.udpClient.Receive(ref ipEndPoint);

this.richTextBoxChatConversation.Text += "I said:" + " " +
System.Text.Encoding.ASCII.GetString(receiveBytes).ToString() + "\r\n";
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}

For a complete sample on how to developa .NET chat application, please
refer to the sample at
http://samples.gotdotnet.com/quickstart/howto/doc/TCPUDP/Broadcast...
.aspx.

Gary

This posting is provided "AS IS", with no warranties, and confers no
rights. Enjoyed ASP.NET? http://w...