Questions tagged [udp]
User Datagram Protocol is one of the messaging protocols of the IP protocol stack. With UDP, computer applications can send messages to other hosts on an Internet Protocol (IP) network without requiring prior communications to set up special transmission channels or data paths.
872
questions
15
votes
1answer
49k views
Simple UDP Socket Tutorial Needed [closed]
I have been searching and reading all day, and have not found a UDP sockets programming tutorial suitable for a newbie. I know UDPClient programming, but, because of the inability of UDPClient to ...
13
votes
2answers
45k views
How to set up a socket for UDP multicast with 2 network cards present?
I'm trying to get udp multicast data using sockets and c++ (c). I have a server with 2 network cards so I need to bind socket to specific interface. Currently I'm testing on another server that has ...
10
votes
2answers
6k views
How to get original destination port of redirected UDP message?
Using this thing I can obtain original destination IP address of socket(PF_INET, SOCK_DGRAM, 0) socket.
How to get original destination port?
9
votes
6answers
26k views
Sending and Receiving arrays via Sockets
Is it possible to send an array through UDP Sockets using Python? I am using Python 2.5 and trying to send a simple array but it's not working. It can send the array successfully but when I try to ...
7
votes
2answers
4k views
WebRTC Data Channel server to clients UDP communication. Is it currently possible?
Is it possible to use WebRTC Data Channels on Node.js in a way that mimics the functionality of WebSockets except using UDP?
In essence I want to have a server running Node.js with which browser ...
6
votes
2answers
7k views
How to work with UDP sockets in iOS, swift?
I'm trying connect to local esp8266 UDP server. SwiftSocket haven't documentation. CocoaAsyncSocket doesn't work.
How to connect and send data to udp server? What i should do?
I wrote sample UDP ...
10
votes
1answer
13k views
GCDAsyncUdpSocket and multicast sending and receiving
In first approach I create client-server app ,based on sampleProject , which send some data to server.
Legend:
sender
address = reciver ip
port = reciver port
reciver
address = null ...
6
votes
5answers
9k views
For UDP broadcast gurus: Problems achieving high-bandwidth audio UDP broadcast over WiFi (802.11N and 802.11G)
I'm attempting to send multichannel audio over WiFi from one server to multiple client computers using UDP broadcast on a private network.
I'm using software called Pure Data, with a UDP broadcast ...
6
votes
2answers
20k views
Creating a pcap file
I need to save UDP packets to a file and would like to use the pcap format to reuse the various tools available (wireshark, tcpdump, ...).
There are some information in this thread but I can't find ...
2
votes
2answers
45k views
sending/receiving file UDP in python
I've made this sending / receiving scripts but i corrupted file !
i have no idea why I'm getting this issue !
sender.py
#!/usr/bin/env python
from socket import *
import sys
s = socket(AF_INET,...
13
votes
2answers
22k views
Error “No such device” in call setsockopt when joining multicast group
I have a code in which send multicast datagrams.
A critical piece of code:
uint32_t port;
int sockfd, err_ip;
const uint32_t sizebuff = 65535 - (20 + 8);
unsigned char *buff = (unsigned char *) ...
9
votes
2answers
19k views
How can I set the buffer size for the underneath Socket UDP? C#
As we know for UDP receive, we use Socket.ReceiveFrom or UdpClient.receive
Socket.ReceiveFrom accept a byte array from you to put the udp data in.
UdpClient.receive returns directly a byte array ...
5
votes
1answer
9k views
Sending Objects Across Network using UDP in Java
I haven't found an exact answer to the problem that I'm having, so I'm going to ask this anyway, and if I did, in fact, repost a question that's already been asked, I apologize.
I'm doing another lab ...
5
votes
4answers
8k views
UDP: Listening to the same port for two different multicast streams
I need to listen to 2 different multicast groups using the same port. Program A will listen from 230.0.0.1 and Program B from 230.0.0.2. Both multicast groups use the same port 2000 and I have no ...
5
votes
3answers
14k views
UDP packet drops by linux kernel
I have a server which sends UDP packets via multicast and a number of clients which are listing to those multicast packets.
Each packet has a fixed size of 1040 Bytes, the whole data size which is ...
3
votes
1answer
3k views
Securing a UDP connection
For a personal MMO game project I am implementing a homebrew reliable UDP-based protocol in java. Given my current setup I beleive it would be relatively simple for a snooper to hijack a session, so ...
2
votes
2answers
4k views
How to use GCDAsyncUdpSocket for multicast over wifi and bluetooth
I am currently using GCDAsyncUdpSocket to send multicast datagrams over wifi between iOS devices.
The Code is pretty simple..
Client
self.socket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self ...
13
votes
2answers
13k views
Can multiple sockets be associated with same port for UDP?
I think multiple sockets can be associated with same TCP port.
But can the same thing work for UDP?
11
votes
2answers
32k views
Simple UDP broadcast client and server on different machines
The following client and server UDP broadcast code works on fine when both are on the same PC. However when I have them on separate PC's in the same WIFI LAN nothing happens at all. I have managed ...
11
votes
7answers
15k views
How to get your own (local) IP-Address from an udp-socket (C/C++)
You have multiple network adapters.
Bind a UDP socket to an local port, without specifying an address.
Receive packets on one of the adapters.
How do you get the local ip address of the adapter which ...
8
votes
2answers
8k views
How to send a packet via a UDP CFSocket?
I am a complete newbie to networking, however I am a c/c++ programmer, and am working in objective-c (This is for OSX/iPhone).
I am trying to learn how to send a magic packet with a UDP socket using ...
6
votes
2answers
10k views
VS2015 : The application was unable to start correctly (0xc000007b)
I wrote a code on Visual studio 2015 for a windows 10 PC. The application is mainly focused on UDP communication and I use the boost libraries.
It works perfectly but when I move the folder of the ...
6
votes
1answer
5k views
TCP vs. UDP socket latency benchmark
I have implemented a small benchmark for socket communication via TCP and UDP in Python. Surprisingly, TCP is almost exactly double as fast as UDP.
To avoid routing effects, server and client are ...
6
votes
2answers
17k views
Set RTSP/UDP buffer size in FFmpeg/LibAV
Note: I'm aware ffmpeg and libav are different libraries. This is a problem common to both.
Disclaimer: Duplicate of SO question marked as answered but actually didn't give a proper solution.
...
5
votes
2answers
5k views
Raw Socket Help: Why UDP packets created by raw sockets are not being received by kernel UDP?
I am studying raw sockets. I used the IP_HDRINCL option to build my own IP headers. After the IP header, I am building a UDP header. Then I am sending the packet to my system's loopback address. I ...
5
votes
1answer
29k views
c udp non-blocking socket with recvfrom and select
I want to implement at the client side non-blocking socket with select function. But it doesn't work as expected. In the code below it never runs into else , rv is always 1 and when nothing is on the ...
5
votes
3answers
2k views
How many packets or bytes are in the socket receive queue?
Calling getsockopt with SO_RCVBUF will return the allocated size of the socket receive buffer.
I am curious to know if it is possible to query for how many datagram packets (or bytes) are actually ...
4
votes
2answers
9k views
UDP receiving data on multiple ports
Is it possible to receive data with recvfrom on 2 ports? I have a port which I use for user requests and another port for chat messages. Is it possible to bind two sockets, with different ports and ...
3
votes
4answers
9k views
How to get rid of the empty remaining of the buffer?
I have a server-client application that is using a datagram socket to exchange messages. I have initially set the buffer size to be 1024 bytes because I dont know the length of the messages. When I ...
14
votes
2answers
1k views
Why are particular UDP messages always getting dropped below a particular buffer size?
3 different messages are being sent to the same port at different rates:
Message size (bytes) Sent everytransmit speed
High &...
13
votes
2answers
2k views
WebRTC Data Channel server to clients UDP communication
Is it possible to use WebRTC Data Channels on Node.js in a way that mimics the functionality (and preferably API) of Socket.io (WebSockets) except using UDP?
In essence I want to have a server ...
12
votes
3answers
9k views
Reliability of UDP on localhost
I know that UDP is inherently unreliable, but when connecting to localhost I would expect the kernel handles the connection differently since everything can be handled internally. So in this special ...
11
votes
4answers
19k views
How to send large data using C# UdpClient?
I'm trying to send a large amount of data (more than 50 MB) using C# UdpClient.
So at first I split the data into 65507 byte blocks and send them in a loop.
for(int i = 0; i < packetCount; i++)
...
10
votes
4answers
26k views
Ensuring packet order in UDP
I'm using 2 computers with an application to send and receive udp datagrams. There is no flow control and ICMP is disabled. Frequently when I send a file as UDP datagrams via the application, I get ...
10
votes
3answers
19k views
Receiving a response through UDP
I have seen applications send a packet through UDP to an IP on some port and receiving a response. Which port does the response go to? (Btw, how can the router know that the response is for my PC, if ...
10
votes
4answers
11k views
AsyncUdpSocket how to use receive
I am trying to get a program for iPhone running on the simulator. My problem is with receiving UDP data. I use asyncUdpSocket. If I make a socket and use sendData:(NSData) toHost:,... well it works ...
9
votes
1answer
14k views
UDP port open check
What is the best way to check if the UDP port is open or not on the same machine. I have got port number 7525UDP and if it's open I would like to bind to it. I am using this code:
while (true)
{
...
9
votes
4answers
7k views
First UDP message to a specific remote ip gets lost
I am working on a LAN based solution with a "server" that has to control a number of "players"
My protocol of choice is UDP because its easy, I do not need connections, my traffic consists only of ...
8
votes
1answer
2k views
For how long a router keeps records in the NAT and can they be reused forwarding requests from other hosts?
There is an answer explaining in simple terms how a router works translating requests from the local network to outside and back (https://superuser.com/questions/105838/how-does-router-know-where-to-...
8
votes
5answers
10k views
UDP send behaviour after connect()
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h&...
8
votes
5answers
3k views
Packet loss while receiving UDP broadcast in android device
For receiving UDP broadcast packets from the server to an android device, i used a service class and listen for packets in a thread. It receives the packet successfully. The problem is that if ...
5
votes
4answers
46k views
UDP Sockets in C
I'm working on a homework problem for class. I want to start a UDP Server that listens for a file request. It opens the file and sends it back to the requesting client with UDP.
Heres the server code....
5
votes
2answers
53k views
sendto : Resource temporarily unavailable (errno 11)
I am having a problem with sendto.
I have a receiver who receives UPD packets with recvfrom and then replies to the sender using sendto.
Unfortunately, I am getting errno 11 (Resource temporarily ...
4
votes
1answer
6k views
Receive udp broadcast packets ios
I'm almost completely done with and iOS client for my REST service. The only thing I'm missing is the ability for the client to listen on the network for a UDP broadcast that receives the host display ...
4
votes
3answers
3k views
Emulating accept() for UDP (timing-issue in setting up demultiplexed UDP sockets)
For an UDP server architecture that will have long-lived connections, one architecture is to have one socket that listens to all incoming UDP traffic, and then create separate sockets for each ...
4
votes
3answers
15k views
setting timeout for recv fcn of a UDP socket
I send a UDP packet by sendto, then receive the answer by recv.if recv does not receive the reply, the program does not proceed. However, the udp packet might be lost, or for some reason, the packet ...
3
votes
1answer
19k views
Pipe UDP input to FFMPEG
A video camera is sending me video data as RTPs via UDP on a local port.
Does ffmpeg support automatically conversion of input (H.264 payload) to MP4 ?
How to do that ?
3
votes
5answers
3k views
packet fragmentation for raw sockets
If I am using raw sockets to send a UDP packet of size 3000bytes, do I need to handle packet fragmentation myself in the code, or should the raw socket handle fragmentation similar to DGRAM socket?
2
votes
1answer
13k views
UDP maximum packet size
I checked the maximum UDP packet size and saw it is 65507 bytes of data.
Which is 65535-8 (udp headers) - 20 (ip headers).
The UDP length header is 2 bytes long which is 65535 limit.
I understand that ...
2
votes
3answers
3k views
Service Fabric Stateless Server Custom UDP Listener
We are trying to define a Service Fabric Stateless Service which listeners for UDP data.
We are working with Microsoft who have said that it IS supported and that I should set up for TCP; below is ...