udpclient

IPFIX data over UDP to C# - can I decode the data?

百般思念 提交于 2019-12-13 14:19:27
问题 I have a code sample from the MSDN website to create a UDP listener/client as I am trying to receive IPFIX/Netflow data from a firewall and then work with the data I receive. The code does work and starts to reveive data but its jargon (see below) so I guess I am not decoding it correctly. Does anyone have any ideas what I need to do to be able to get the data in the correct format? The code I am using is: using System; using System.Net; using System.Net.Sockets; using System.Text; public

To write chat programming using UDP and MQTT protocol in Android

 ̄綄美尐妖づ 提交于 2019-12-13 08:31:11
问题 I am new in Android programming and don't know how to work with UDP and MQTT protocol in android device I want to build an application for chatting android to android device within room connected to same Wi-Fi router. But I don't know what IP address and port I should bind to DatagramSocket and DatagramPacket. I tried lot of examples from online but I didn't understand how it will work in android. 回答1: MQTT requires TCP, it is a statefull protocol, you can not implement it with UDP There is a

UDP Sending / Receiving in .NET

隐身守侯 提交于 2019-12-13 04:03:05
问题 I'm new to UDP. Using a test environment, I am able to send/receive a single UDP message. However, I’m trying to figure out how to receive multiple UDP messages. I'd like MyListener service to receive UDP packets all day long, whenever I send them. I appreciate any help. PS - As noted below in an answer, if I put a while(true) around my DoSomethingWithThisText, that will work while debugging. However, it won't work when trying to run MyListener as a service, because Start will never get past

C# Broadcast is UDP message, listen for multiple replies

旧城冷巷雨未停 提交于 2019-12-12 17:50:29
问题 I am trying to write some code that does a UDP broadcast, and then listens to replies from remote servers saying they exist. It's used to identify machines running a server app on the subnet so basically sends out a "who's there?" and listens for all the replies. I have this in Java (works perfectly) where it sends a DatagramPacket broadcasting to a group address of 224.168.101.200. and then has a worker thread that keeps listening for incoming DatagramPackets coming in on the same socket.

Can UDP retransmit lost data?

夙愿已清 提交于 2019-12-12 13:24:42
问题 I know the protocol doesn't support this but is it common for clients that require some level of reliability to build into their application a method for requesting retransmission of a packet if found to be corrupt? 回答1: It is common for clients to implement reliability on top of UDP if they need reliability (or sometimes just some reliability) but not any of the other things that TCP offers, for example strict in-order delivery, and if they want, at the same time, low latency (or multicast,

UDP - Can I send two datagram parts, and make the receiving end combine them into one?

纵然是瞬间 提交于 2019-12-12 09:39:30
问题 This is maybe a stupid question, but since I am relatively new to UDP here it goes... If I am having two separate byte arrays that I need the receiving side to get as one big array, for example: byte[] Array1 = {1,1,1} byte[] Array2 = {2,2,2} Can I avoid having to create a buffer and copy each array into it, and then send that buffer, like this: byte[] Buffer= new byte[Array1.Length + Array2.Length]; Buffer.BlockCopy(Array1, 0, Buffer, 0, Array1.Length); Buffer.BlockCopy(Array2, 0, Buffer,

Error receiving in UDP: Connection refused

拈花ヽ惹草 提交于 2019-12-12 07:45:58
问题 I am trying to send a string HI to a server over UDP in a particular port and then to receive a response. However, after I try to get the response using recvfrom() I was stuck in blocking state. I tried using connected UDP but I got: Error receiving in UDP: Connection refused What could be the reasons for this? The server is not under my control, but I do know its working fine. I have added the code int sockfdudp; char bufudp[MAXDATASIZE], port[6]; struct addrinfo hints, *servinfo, *p; struct

UDPClient Begin received packet source address

匆匆过客 提交于 2019-12-12 04:46:10
问题 I have a service in VB.NET (2010) that is receiving a UDP packets with UDPClient.BeginReceive asynchronously. Everything is working fine, I'm able to receive a packet data - but I'm not able to get sender (or remote) endpoint. There is a CallBack routine that is receiving an IAsyncResult object, that is represented by System.net.sockets.OverlappedAsyncResult where in property SocketAddress is a byte array where is a sender port and sender IP address. But it is accessible only in debug time -

Problem Trying to unicast packets to available networks

早过忘川 提交于 2019-12-11 10:58:37
问题 Trying to unicast packets to available networks. There are totally 3 networks. Managed to get packets in only one network.But i am not able to receive the packets in different networks. using this code.. foreach (var i in System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()) { foreach (var ua in i.GetIPProperties().UnicastAddresses) { System.Windows.Forms.MessageBox.Show(ua.Address.ToString()); IPAddress Tip = IPAddress.Parse(ua.Address.ToString()); IPEndPoint

UdpClient Receives Data on multiple listeners

随声附和 提交于 2019-12-11 05:26:27
问题 I have an application which implements an autodiscovery mechanism and I'm having an issue with the UdpClient. It works fine as long as a single instance of the application is open. However, when a second instance is open only the first receives the unicast packets. Interestingly enough, a similar application that implements the same mechanism doesn't seem to have this issue. Any suggestions? class AutoDiscovery { private UdpClient Udp; private IPEndPoint BroadcastEP = new IPEndPoint(IPAddress