Re: System.Net.Sockets.SocketException -UDP
- From: "Thomas Scheidegger [MVP]" <spam.netmaster@xxxxxxxxxxxxxx>
- Date: Tue, 4 Oct 2005 14:52:15 +0200
Hallo Torben
> ich sende ein UDP-Protocol und warte auf eine Antwort (die laut
> UdpClient udp_listener = new UdpClient();
> IPEndPoint receiveEndPoint = new IPEndPoint(IPAddress.Any ,0);
> Byte[] receiveBytes;
> receiveBytes = udp_listener.Receive( ref receiveEndPoint ); //Hier kommt > ein Fehler!
gib beim UdpClient-Konstruktor die (Empfangs-) Port-Nummer an, etwas wie:
// hier zB 11000 als lokalen Port binden
UdpClient udpClient = new UdpClient( 11000, AddressFamily.InterNetwork );
IPEndPoint remoteIPEndPoint = new IPEndPoint( IPAddress.Any, 0 );
byte[] receivedBytes = udpClient.Receive( ref remoteIPEndPoint );
--
Thomas Scheidegger - MVP .NET - 'NETMaster'
http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/
.
- Follow-Ups:
- Re: System.Net.Sockets.SocketException -UDP
- From: Torben Schulz
- Re: System.Net.Sockets.SocketException -UDP
- From: Torben Schulz
- Re: System.Net.Sockets.SocketException -UDP
- References:
- System.Net.Sockets.SocketException -UDP
- From: Torben Schulz
- System.Net.Sockets.SocketException -UDP
- Prev by Date: Re: treeview aus datenbank erstellen
- Next by Date: Re: Zugriff über Klassen hinweg auf eine static Funktion
- Previous by thread: System.Net.Sockets.SocketException -UDP
- Next by thread: Re: System.Net.Sockets.SocketException -UDP
- Index(es):