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

Join multicast group using DatagramChannel without specifying network interface

When using java's multicast socket I can join a multicast group without specifying a NetworkInterface using this code: MulticastSocket sock = new MulticastSocket(PORT); sock.joinGroup(ADDR); If I want to use NIO on the other hand I can do:…
bennyl
  • 2,886
  • 2
  • 29
  • 43
3
votes
1 answer

LuaSocket (UDP) not receiving datagrams

I'm experimenting with LuaSocket for a project I'm working on. I've chosen UDP as my protocol. Looking for docs and tutorials online, I've attempted to create a client-server pair for testing and learning. According to what I've read, the following…
account3r2
  • 43
  • 1
  • 5
3
votes
1 answer

The receiveBufferSize not being honored. UDP packet truncated

netty 4.0.24 I am passing XML over UDP. When receiving the UPD packet, the packet is always of length 2048, truncating the message. Even though, I have attempted to set the receive buffer size to something larger (4096, 8192, 65536) but it is not…
Chris M
  • 31
  • 3
3
votes
0 answers

How to send a HashMap with DatagramPacket?

I know that i can send a ArrayList to a ip using code below. List list = new ArrayList(); ByteArrayOutputStream out = new ByteArrayOutputStream(); ObjectOutputStream outputStream = new…
Lasitha Yapa
  • 4,309
  • 8
  • 38
  • 57
3
votes
1 answer

File Channel reads/adds wrong data

I am using a filechannel with a byte buffer to send packets over the network. My problem is that when the filechannel reads the last few bytes it appends the last bit of data from previous bytes read even though I am clearing the byte buffer after I…
user3339242
  • 631
  • 2
  • 15
  • 32
3
votes
3 answers

Java DatagramSocket sending but not receiving

I'm working on a game in Java, and I'm trying to communicate between a client and server on the same computer over the internet, and eventually between multiple computers. I used to be able to, but now the server doesn't seem to be receiving any…
Joe Boris
  • 487
  • 3
  • 8
  • 15
3
votes
6 answers

Is it possible to send datagrams over TCP?

In theory nothing prevents using TCP socket with SOCK_DGRAM. What you'll get is reliable datagram transport. Is this possible using Berkeley sockets?
sustrik
  • 179
  • 1
  • 5
3
votes
1 answer

Android: SSDP stuck on MulticastSocket.receive()

TL;DR: SSDP library not receiving datagram. Wireshark shows expected(?) traffic. I am using the android-dlna library to support SSDP in an Android app. The goal is to discover a custom SSDP-enabled device, get its IP Address, then make RESTful API…
Phil
  • 35,852
  • 23
  • 123
  • 164
3
votes
1 answer

How to send audio stream via UDP in java?

I have a problem, i have set MediaLocator to microphone input, and then created Player. I need to grab that sound from the microphone, encode it to some lower quality stream, and send it as a datagram packet via UDP. Here's the code, i found most…
Nob Venoda
  • 543
  • 1
  • 6
  • 14
3
votes
2 answers

Is it possible to have multiple threads listening on the same DatagramSocket?

I'm writing a chat program in java and I have been stuck for hours with this problem. This is my class that waits for clients to connect to the server. Every time a new client connects I create a new ChatClient(String name, DatagramSocket…
Jakkra
  • 641
  • 8
  • 25
3
votes
1 answer

Unix domain socket : Make Latency constant

Issue summary: AF_UNIX stable sending, bursty receiving. I have an application B that receives data over unix domain datagram socket. There is peer application A that sends data to it. Both A and B are running continuously (and are SCHED_FIFO). My…
Lunar Mushrooms
  • 8,358
  • 18
  • 66
  • 88
3
votes
1 answer

Concurrent server using datagrams

A client has to send 2 strings to a server and the server has to send back a string to the client and also treat clients in parallel. The 2 entities exchange data using datagrams under Unix. My problem is that when I use threads I can't send back…
ironflower
  • 101
  • 1
  • 4
  • 11
3
votes
2 answers

UDP - Read data from the queue in chunks

I'm implementing a small application using UDP (in C). A server sends to a client the data from a given file in chunks of given amount (ex. 100 bytes / call). The client downloads the file and saves it somewhere. The catch is that the client can…
Adi Ulici
  • 1,285
  • 8
  • 18
3
votes
2 answers

Java: Receiving an UDP datgram packet with multiple DatagramSockets

I am trying to implement a method that sends an UDP packet to multiple receivers. I thought that this should be doable setting setReuseAddress(true) on the receiving DatagramSocket instances. My problem is that in certain conditions I need to limit…
Robert
  • 39,162
  • 17
  • 99
  • 152
3
votes
1 answer

DatagramSocket cannot receive data from UdpClient

I am making an Win RT app that connects to a desktop app and they start to communicate in UDP and TCP. I have successfully implemented TCP communication in that I can send from Win RT to Desktop and send from Desktop to Win RT. using StreamSocket on…
Peyman
  • 3,059
  • 1
  • 33
  • 68