J'utilise la fonction ci-dessous à l'intérieur d'un thread pour recevoir l'octet [] via la prise . Comme ma machine possède deux adaptateurs réseau, elle reçoit l'octet [] deux fois. Je veux sauter le même octet suivant [] reçu.Comment passer l'octet suivant [] reçu du socket en utilisant C#
Que dois-je faire pour réaliser ceci?
public void Receiver()
{
strMultpileBatchString = "";
string mcastGroup = ReceiverIP;
string port = ReceiverPort;
//Declare the socket object.
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
//Initialize the end point of the receiver socket.
IPEndPoint ipep = new IPEndPoint(IPAddress.Any, int.Parse(port));
s.SetSocketOption(SocketOptionLevel.Udp, SocketOptionName.NoDelay, 1);
s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, 1);
s.Bind(ipep);
s.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, 0);
IPAddress ip = IPAddress.Parse(mcastGroup);
s.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(ip));
while (true)
{
byte[] b = new byte[BytesSize];
}
}