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.

630 questions
3
votes
1 answer

Using NIO DatagramChannel will I need to handle partially read/written packets?

When using SocketChannel, you need to retain read and write buffers to handle partial writes and reads. I have a nagging suspicion that it might not be needed when using a DatagramChannel, but info is scarce. What is the story? Should I call…
Nuoji
  • 3,438
  • 2
  • 21
  • 35
3
votes
1 answer

How to use Oboe (the C++ library for low latency audio for Android) to receive the byte[] buffer from DatagramPacket?

I would like to do audio live streaming over WiFi between 2 Android devices. In order to reduce the audio latency, applying the Oboe C++ library seems to be a right direction to go. My current structure is to use DatagramPacket to transmit and…
MAGNETO
  • 31
  • 2
3
votes
2 answers

Using QUdpSocket to send datagrams

I am trying to send a datagram using QUdpSocket. The following is the code I am using: udpSocket = new QUdpSocket(this); QByteArray datagram = "Message"; udpSocket->writeDatagram(datagram.data(), datagram.size(), QHostAddress::Broadcast,…
John Gaby
  • 1,500
  • 3
  • 19
  • 33
3
votes
0 answers

Is there a limit above max_dgram_qlen and wmem_{max,default}?

I am trying to determinate the different limits of the unix datagram sockets, as I am using it as IPC for my project. The obscure thing I want to control is the size of my socket's internal buffer : I want to know how many datagrams I can send…
xar
  • 31
  • 3
3
votes
1 answer

Android UDP peer to peer networking communication (without server)

I am new in Android networking and working on project p2p without server. Initially I have to do communication between 2 devices. I achieved successful communication between two wifi networks within and behind different NATS via DataGramSocket with…
Bari
  • 31
  • 4
3
votes
1 answer

Sending to a Datagram socket, without blocking indefinitely

We have some code to send metrics to a SOCK_DGRAM where another daemon listens and aggregates/proxies these messages. Opening the socket looks like: sock <- socket (ai :: AddressInfo Inet Datagram UDP):_ <- getAddressInfo (Just "127.0.0.1") Nothing…
jberryman
  • 16,334
  • 5
  • 42
  • 83
3
votes
2 answers

Trimming 0x00 in received DatagramPacket

In my Java app I receive DatagramPacket(s) through DatagramSocket. I know the maximum number of bytes which packet could contain, but actually every packet length varies (not exceeding max length). Let's assume that MAX_PACKET_LENGTH = 1024 (bytes).…
omnomnom
  • 8,911
  • 4
  • 41
  • 50
3
votes
2 answers

Audio streaming quality not good in datagramsocket with fixed datagram packets length in android

Am streaming audio through datagrampackets using datagramsockets for telephonic conversation. I can able to hear audio from other end. But Other end can't hear my audio. Here data packets are fixed to 340byte. First 20 bytes have some value for…
Nas
  • 2,158
  • 1
  • 21
  • 38
3
votes
1 answer

how do i get amount of datagram queued in a unix domain socket

I need to get the amount of datagrams queued/pending in a unix datagram socket and yet to be received. I see that max_dgram_qlen gives what is the maximum of datagrams that can be queued in the receive buffer after which it will be blocked. But, is…
Kumar
  • 31
  • 2
3
votes
1 answer

UWP DatagramSocket Multicast

I managed to make a simple application that sends and receives data from a multicast group. If I open 2 instance of the application (2 different .sln files with the same code) I can send and receive data. The problem is that after 5 seconds, if I…
Stefan
  • 188
  • 2
  • 19
3
votes
1 answer

Why does Java DatagramSocket return false on "isConnected" when it is definitely connected?

I am following the simple UDP tutorial HERE, but I am running into an issue. //DSender.java import java.net.*; public class DSender{ public static void main(String[] args) throws Exception { try{ DatagramSocket ds = new…
Brian
  • 1,726
  • 2
  • 24
  • 62
3
votes
3 answers

Byte Operations and Datagrams in Java

I am trying to program a handshake type message as follows where C=Client S=Server: C-->S: "I'd like to talk" //session initiation S-->C: "80" //(n, randomly generated number) C-->S: "81" //(n+1) S: "does n= (n+1)-1?" //confirms the…
Matt Lick
  • 31
  • 2
3
votes
0 answers

Java DatagramSocket is able to receive packets on windows but not linux

Note that in this thread the poster seems to have a problem related to mine: DatagramSocket Broadcast Behavior (Windows vs. Linux) Unfortunately this post died without any solution to the problem. I am currently having some problems with…
3
votes
1 answer

how can I send raw packets over wifi without a network?

I am trying to send some data between 2 raspberry pi's over wifi without them being connected to a network. I want it to work similar to the way beacons and probe requests work, where a broadcast can be sent out the wireless interface. the data I…
Alec Cutler
  • 55
  • 2
  • 6
3
votes
1 answer

Server alternates between users instead of broadcasting

I have been working on a message system where users type in a server IP/Port and that server then takes in messages and relays them to all other users on the server. The whole program was based of a echo server i rewrote from scratch, for every…
Harry Saliba
  • 116
  • 1
  • 11