Questions tagged [datagram]

A datagram is a unitary message delivered entire over a network, typically via UDP, and typically with no guarantee on order or reliability of message delivery.

Datagrams support connection-less messages of a fixed maximum length. While datagrams allow for a bi-directional data flow, the order and reliability of message delivery is not guaranteed. A process receiving datagrams may find messages duplicated or missing or in an order different than the order sent. However, record boundaries in data are respected. Datagrams closely model the facilities found in many contemporary packet-switched networks.

618 questions
6
votes
4 answers

Datagram Transport Layer Security (DTLS) on Android/Java

Has anyone used DTLS on Android or is there an open source Java implementation that supports DTLS? What are my other options for securing UDP traffic on Android?
Soumya Simanta
  • 10,777
  • 23
  • 95
  • 153
6
votes
5 answers

Java dropping half of UDP packets

I have a simple client/server setup. The server is in C and the client that is querying the server is Java. My problem is that, when I send bandwidth-intensive data over the connection, such as Video frames, it drops up to half the packets. I make…
Andrew Klofas
  • 560
  • 1
  • 6
  • 18
6
votes
2 answers

What does FIONREAD of UDP (datagram) sockets return?

Which one does ioctl of FIONREAD return, the next packet's length, or the length of all data in the buffer? Suppose there is a UDP server that receives 2 packets from a client 1 and another 2 packets from client 2 after client 1's packet. Then, what…
minmaxavg
  • 656
  • 6
  • 20
6
votes
2 answers

Is it possible to use just 1 UDPSocket for sending/receiving on the same port?

I'm trying to send a DatagramPacket, and then must wait for an Acknowlegment from sever, so that I know if I have to resend the same packet or send the next one.. I'm using for that the same socket on the client, to send the datapacket and to…
ZelelB
  • 1,546
  • 5
  • 31
  • 60
5
votes
1 answer

Any suggestions on how to wait for an unknown length packet on a socket, and do some processing with its payload bytes as efficiently as possible?

I need to write an UDP server which will wait for packets from uncorrelated devices (max 10000 of them) sending small packets periodically; do some processing with the payload and write the results on SQL. Now I'm done with the SQL part through…
V4R15
  • 87
  • 1
  • 6
5
votes
4 answers

Need to send a UDP packet and receive a response in Java

I have to send a UDP packet and get a response back from UDP server. I though UDP was analogous with a java.net.DatagramPacket in Java, but the documentation for DatagramPacket seems to be that you send a packet but don't get anything back, is this…
Paul Taylor
  • 12,050
  • 34
  • 149
  • 295
5
votes
3 answers

How to make two-directional unix domain sockets with SOCK_DGRAM?

I am trying to write a simple Unix datagram server/client, and am having some problems. What I want is a server that listens on a datagram socket and sends a reply to every message received, to the original sender. I decided to try first using socat…
fyhuang
  • 1,897
  • 5
  • 19
  • 23
5
votes
4 answers

"Lost" UDP packets (JBoss + DatagramSocket)

I develop part of some JBoss+EJB based enterprise application. My module needs to process huge amount of incoming UDP packets. I've done some load testing and it looks that in case of sending packets with 11ms interval everything is fine, but in…
omnomnom
  • 8,215
  • 4
  • 39
  • 50
5
votes
0 answers

Occasional java.io.IOException: Operation not permitted only on Android 7.0 by DatagramSocket.send()

The following code works fine virtually 100% time on all Android device Android 7.0: DatagramSocket clientSocket = new DatagramSocket(); clientSocket.setSoTimeout(4000); clientSocket.setReuseAddress(true); …
Hong
  • 15,059
  • 14
  • 64
  • 105
5
votes
2 answers

MediaRecorder and UDP (DatagramSocket) in Android

I am currently writing a program that is a sort of VoIP client. I am trying to establish a connection between 2 clients and send and receive data, that is recorded from microphone. I am currently using files but it looks like an awful…
Jary
  • 155
  • 4
  • 10
5
votes
0 answers

How to read /dev/log?

I would like to directly access to syslog messages from Python by reading /dev/log. My (very limited) understanding is that the correct way is to read from there is to bind a datagram socket. import socket sock = socket.socket(socket.AF_UNIX,…
WoJ
  • 19,312
  • 30
  • 122
  • 230
5
votes
0 answers

Write/Read packets generating garbage

I have a client on Android that uses the TUN interface exposed by the Android VPNService in order to intercept packages. In that regard I read all incoming packets and write them to the TUN interface. This basically means that I do a write for each…
Simon Langhoff
  • 1,225
  • 3
  • 15
  • 26
5
votes
1 answer

Send and receive using Datagramsocket simultaneously in Android - Just send?

I am using DatagramSocket in one Thread to receive and in another Thread to send data to PC (Java). but it just send data every 1 second but does not receive. But when I put receive code in the same Thread after sending code ... it works ... but I…
user3157047
  • 409
  • 5
  • 15
5
votes
1 answer

Is Multicast broken for Android 2.0.1 (currently on the DROID) or am I missing something?

This code works perfectly in Ubuntu, Windows, and Mac OS X. It also works fine with a Nexus One running Android 2.1.1. I start sending and listening multicast datagrams, and all the computers and the Nexus One will see each other perfectly. Then I…
Gubatron
  • 5,581
  • 5
  • 31
  • 35
5
votes
1 answer

NodeJS Datagram - Receive IPv6 multicast

I'm trying to receive multicast datagrams over IPv6 in node.js. I had no problems doing it exactly same way over IPv4 (udp4), but trying to do the same for udp6 gives me EINVAL Errors on socket.addMembership call. Here is my code: var dgram =…
1 2
3
41 42