udpclient

Swift: Receiving UDP packets from server on serial port monitor but not in ios app

一曲冷凌霜 提交于 2020-01-03 06:19:06
问题 I send UDP packets to a wifi module and receive them and i monitor them in serial port monitor successfully but unable to receive them in iOS app. I'm using Network Framework both for connecting and receive. The connection part works perfectly but when i set a listener to the port, and try to get rsponse the receiveMessage doesn't get called although i see outpackets that module sends. class func connect() { connection = NWConnection(host: hostUDP, port: portUDP, using: .udp) connection?

how can I parse a UDP packet in .NET?

我怕爱的太早我们不能终老 提交于 2020-01-02 17:18:48
问题 how can I parse a UDP packet in .NET? I'm using PCap.Net to capture packets, in this case UDP packets, which I can access from the PCap.net object via (PcapDotNet.packets.Ethernet.IpV4.Udp). How can I take the results, the Udp packet, and parse this? In particular to unbundle DNS requests and responses that occur that are housed within a UDP packet. Is there a library that could help here? EDIT : To be more specific what I want to be able to do is extract the IP address from the DNS response,

Can I set the timeout for UdpClient in C#?

帅比萌擦擦* 提交于 2019-12-28 13:00:17
问题 I am wondering whether I can set a timeout value for UdpClient receive method. I want to use block mode, but because sometimes udp will lost packet, my program udpClient.receive will hang there forever. any good ideas how I can manage that? 回答1: What Filip is referring to is nested within the socket that UdpClient contains ( UdpClient.Client.ReceiveTimeout ). You can also use the async methods to do this, but manually block execution: var timeToWait = TimeSpan.FromSeconds(10); var udpClient =

Can I set the timeout for UdpClient in C#?

Deadly 提交于 2019-12-28 12:59:48
问题 I am wondering whether I can set a timeout value for UdpClient receive method. I want to use block mode, but because sometimes udp will lost packet, my program udpClient.receive will hang there forever. any good ideas how I can manage that? 回答1: What Filip is referring to is nested within the socket that UdpClient contains ( UdpClient.Client.ReceiveTimeout ). You can also use the async methods to do this, but manually block execution: var timeToWait = TimeSpan.FromSeconds(10); var udpClient =

ASP.NET Multicast UdpClient problems

家住魔仙堡 提交于 2019-12-24 19:29:27
问题 I'm trying to have my ASP.NET app listen for multicast UDP broadcasts. Unfortunately, I seem to be stuck in a bind due to permissions/api issues. The problem is that I need to allow multiple instances of an application to listen to the same IP/Port since multiple spin-ups of the ASP.NET application will occur. To do this, the SocketOptionName.ReuseAddress must be set to true. The problem is that this requires administrative privileges that my ASP.NET app should not have. Here's the code:

Problems with sending UDP packets (milight, limitlessled)

流过昼夜 提交于 2019-12-24 10:50:01
问题 I trying to write a menubar app to get control over my lights via Mac. I'm using the system of milight (limitless, easybulbs...). They have an open system were you can send commands via UDP. I'm able to control my lights via python-limitless library in python, so I know the networking thing such as IP and port is right. So I think I do anything wrong with this UDP stuff I never worked with. I'm trying to use SwiftSocket library to send my commands but nothing happens, I've been trying it

The performance (or other) differences between raw Socket and UdpClient?

会有一股神秘感。 提交于 2019-12-24 08:23:00
问题 As we know .Net has UdpClient for simple Socket usage for UDP. From MSDN: If you are writing a relatively simple application and do not require maximum performance, consider using TcpClient, TcpListener, and UdpClient. These classes provide a simpler and more user-friendly interface to Socket communications. I am wondering how much performance differences between Raw Socket and UdpClient? I know UdpClient is a wrapper of socket for Udp and it does not have asynchron read/write. Anything else?

UDPClient Receive method not working in a service

本小妞迷上赌 提交于 2019-12-24 02:23:10
问题 I've been experimenting the UDP sending and receiving in C# and have a strange issue. The code works fine in a console app, but the client.Receive method is blocked when I try to use the exact same code in a Service. The Service runs normally and doesn't abort, and I have logging writing to a text file, so I know it gets to the Receive. Anyone have any ideas? Code below... public partial class Service1 : ServiceBase { private bool serviceStarted = false; Thread listenerThread; public Service1

use .Net UdpClient in a multithreaded environment

こ雲淡風輕ζ 提交于 2019-12-19 10:19:10
问题 I have an instance of a class (lets call it A) which serves some threads, this instance only sends UDP packets via the UdpClient class. It initialize the the UdpClient in its constructor and only serves to send the packets. It looks something like: public class A{ private UdpClient m_Client; public class A(string host, int port){ m_Client = new UdpClient(host, port); } public void Send(string dataToSend){ var data= encoding.GetBytes(dataToSend); client.BeginSend(data, data.Length, null, null)

Cause of high UDP package loss on localhost?

∥☆過路亽.° 提交于 2019-12-18 05:55:58
问题 In my WPF 4.0 application, I have a UDP listener implemented as shown below. On my Windows 7 PC, I'm running both server and client on localhost . Each received datagram is a scanline of a larger bitmap, so after all scanlines have been received the bitmap is shown on the UI thread. This seems to work. However, occasionally some 1-50% scanlines are missing. I would expect this on a weak network connection, but not when run locally. What may cause UDP package loss with the following piece of