G
goa
Hi all,
I'm trying to implement basic broadcasting functionality via UDP.
Its all working except for the fact that if the message is over 1472
bytes it does not seem to be received by the client app... and theres
no exceptions being raised (by either the server or client).
I've read a number of posts indicating that you should be able to send
messages of over 50,000 bytes, and no one has seem to have struck the
same problem. I'm new to UDP so am I just missing something simple?
I'm determining the 1472 bytes just from the byte array i'm passing in.
The code is basically as below (but i've stripped out all the
threading, etc):
Server:
public class UDPBroadcaster
{
private IPEndPoint ipEP = null;
private UdpClient server = null;
public void Send(string message)
{
byte[] data = System.Text.Encoding.ASCII.GetBytes(message);
this.server.Send(data, data.Length, this.ipEP);
}
}
Client:
public void Receive()
{
IPEndPoint ipEP = new IPEndPoint(IPAddress.Any, this.port);
byte[] data = client.Receive(ref ipEP);
stringData = System.Text.Encoding.ASCII.GetString(data, 0,
data.Length);
}
Thanks,
George.
I'm trying to implement basic broadcasting functionality via UDP.
Its all working except for the fact that if the message is over 1472
bytes it does not seem to be received by the client app... and theres
no exceptions being raised (by either the server or client).
I've read a number of posts indicating that you should be able to send
messages of over 50,000 bytes, and no one has seem to have struck the
same problem. I'm new to UDP so am I just missing something simple?
I'm determining the 1472 bytes just from the byte array i'm passing in.
The code is basically as below (but i've stripped out all the
threading, etc):
Server:
public class UDPBroadcaster
{
private IPEndPoint ipEP = null;
private UdpClient server = null;
public void Send(string message)
{
byte[] data = System.Text.Encoding.ASCII.GetBytes(message);
this.server.Send(data, data.Length, this.ipEP);
}
}
Client:
public void Receive()
{
IPEndPoint ipEP = new IPEndPoint(IPAddress.Any, this.port);
byte[] data = client.Receive(ref ipEP);
stringData = System.Text.Encoding.ASCII.GetString(data, 0,
data.Length);
}
Thanks,
George.