Questions tagged [udpclient]

UdpClient (System.Net.Sockets.UdpClient) is a .NET-Class allowing to send and receive UDP-Traffic.

575 questions
4
votes
2 answers

Handling TUdpSocket

I'm trying to use the TUdpSocket in Delphi. What I want to do is connect to a UDP server, send some data and wait for answer. Data is sent correctly, but the control does not receive anything. I don't know why. I've been struggling with this problem…
Mariusz Schimke
  • 3,185
  • 8
  • 45
  • 63
4
votes
1 answer

How can I be sure that a UDP message is received?

Suppose I have a UDP socket and send a msg to the server. Now how to figure out if the msg has been received by the server? Coded acknowledgment from server is a trivial option, is there any other way to find out? I guess no..
paper.plane
  • 1,201
  • 10
  • 17
4
votes
3 answers

C#.Net UdpClient Receive Event

I'd like to find out if there is any way I could somehow fire an event when my UdpClient receives data? (System.Net.Sockets.UdpClient) I tried overriding it's UdpClient.Receive but I can't according to this because overridable members have to be…
Stuyvenstein
  • 2,340
  • 1
  • 27
  • 33
4
votes
1 answer

Delay in showing image use bitmap in android

I receive continuous UDP data (RAW image) from my device. Decoding it and use bitmap show on my Android phone so it will look like a video. The problem is that the frame don't show continuously. The frame change approx. per 2~3 seconds but I want…
DekangHu
  • 155
  • 4
  • 14
4
votes
1 answer

How do I correctly set up my UdpClient to listen on the multicast address 239.255.255.250:1900 in C#

I am setting up a small local network with 3 laptops. My goal is to experiment with the UpNP protocol and have the laptops discover each other using UpNP. In order to do this, they need to be able to listen for notifications from each other. As…
Curtis
  • 5,794
  • 8
  • 50
  • 77
4
votes
2 answers

D language: UDP client does not receive reply

I have created a toy example for a UDP echo client and server. However, I do not receive the reply from the server and I wonder what am I doing wrong. Client: #!/usr/bin.rdmd import std.stdio; import std.socket; import std.string; import…
marcmagransdeabril
  • 1,445
  • 16
  • 27
4
votes
1 answer

Cannot receive UDP packets inside Unity game

So, I have this game, written in Unity, which is supposed to receive data in real-time over UDP. The data will be coming over wireless from an android device, written in Java, while the Unity program is written in C#. My problem is, whenever I try…
Debadeep Sen
  • 435
  • 7
  • 18
3
votes
1 answer

why is the UDPclient multicast not working?

public void send_multicast(string message) { UdpClient c = new UdpClient(10102); Byte[] sendBytes = Encoding.ASCII.GetBytes(message); IPAddress m_GrpAddr = IPAddress.Parse("224.0.0.1"); IPEndPoint ep = new…
user494461
3
votes
1 answer

udpclient receives broadcast only locally (c#, Unity)

I want to receive a UDP message which was broadcasted to 255.255.255.255 with a UdpClient within Unity. But whatever combination of settings I try, it only receives a message, if it was sent from localhost. I have tried fitted example code from…
IARI
  • 1,217
  • 1
  • 18
  • 35
3
votes
3 answers

UDPClient Async BeginReceive is very slow

I am using UDPClient to send multicast request and receive response from various clients on the network. I am able to send request and also getting response, but response that I get is very slow. It take 2-3 minutes to get response from all the…
Sandeep
  • 320
  • 2
  • 4
  • 18
3
votes
0 answers

Xamarin Android try/catch does not work with udp.SendAsync()

I've built a simple app that talks over UDP, to an endpoint at an IP the user specifies. It uses System.Net.Sockets.UdpClient, which works pretty well on Android - I'm able to send and receive packets fairly consistently. With one glaring…
Chris Moschini
  • 36,764
  • 19
  • 160
  • 190
3
votes
0 answers

Unity UDPClient not receiving broadcast on android build. Editor works. Targeting phone IP works

I'm using a very standard UDP client code. It works fine in Unity Editor. But when build to android phone, I got no response. The sender is a well tested windows program (I also tried other udp senders from online) and I'm only building a receiver…
3
votes
1 answer

How to receive UDP packets from a specific remote client per UdpClient? (.Net 4.6)

I'm trying to figure out how a server will distinguish between multiple clients that connect to it via TCP listener, and begin sending UDP messages to a UdpClient. The TcpListner makes it easy for TCP, because a TcpClient is returned that I can…
Alluring Topaz
  • 75
  • 1
  • 1
  • 9
3
votes
1 answer

UdpClient not failing when endpoint is unavailable

It was my expectation that, if the endpoint is not available, the UdpClient.Connect() method would throw an exception that I could capture and, say, alter a label's text to say if the program was connected to the server or not. However, despite me…
dantdj
  • 1,237
  • 3
  • 19
  • 40
3
votes
3 answers

C# Use async/await on UdpClient Receive

The following code uses Task to receive asyncronously and shows the received result in the console: private void ReceiveMessage() { Task.Run(async() => { using(var udpClient = new UdpClient(15000)) { …
FinFon
  • 85
  • 1
  • 2
  • 8