ew IPEndPoint(IPAddress.Any, 0);
data = newsock.Receive(ref sender);
Console.WriteLine("Message received from {0}:", sender.ToString());
Con
Tag: udp
C# Programmation Réseau: Gérer les socket dans un Thread
void sendPackets()
{
Socket sock = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
sock.SetSo
C# Programmation Réseau: Exemple d’un Serveur de diffusion avec le protocole UDP
oding.ASCII.GetBytes(hostname);
sock.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
sock.SendTo(data, iep1);
sock.
C# Programmation Réseau: Diffuser un message avec le protocole UDP
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
public class BadBroadcast {
public static void Main()
{
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
IPEndPoint iep = new IPEndPoint(IPAddress.Broadcast, 9050);
byte[] data = Encoding.ASCII.GetBytes("This is a test message");
sock.SendTo(data, iep);
sock.Close();
}
}
C# Programmation Réseau: Recevoir les données d’un serveur de diffusion UDP
int)iep;
Console.WriteLine("Ready to receive...");
byte[] data = new byte[1024];
int recv = sock.ReceiveFrom(data, ref ep);
string stri
C# Programmation Réseau: Créer une application de chat avec une socket MulticastSocket
()
{
Text = "Multicast Chat Program";
Size = new Size(400, 380);
Label label1 = new Label();
label1.Parent = this;
label1.Text
C# Programmation Réseau: Exemple d’une application qui accède aux routeurs CISCO
Router()
{
Text = "Cisco Router Utilization";
Size = new Size(400, 380);
Label label1 = new Label();
label1.Parent = this;
lab
C# Programmation Réseau: Exemple d’un Client UDP
server.SendTo(data, data.Length, SocketFlags.None, ipep);
IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);
EndPoint tmpRemote = (EndPoi
C# Programmation Réseau: Créer une application SNMP
MP information:");
// Send sysName SNMP request
response = conn.get("get", argv[0], argv[1], "1.3.6.1.2.1.1.5.0");
if (response[0] == 0xff)
C# Programmation Réseau: Exemple d’un Serveur Udp
ype.Udp);
newsock.Bind(ipep);
Console.WriteLine("Waiting for a client...");
IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);
EndP