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
2
votes
1 answer

What to do about UDP packets arriving in pieces

I have a Java application that is receiving UDP packets in a loop: while (running) { try { // Block until a packet is received on the port byte[] buffer = new byte[1024]; DatagramPacket receivePacket = new…
tomsrobots
  • 307
  • 1
  • 3
  • 10
2
votes
1 answer

Are WebSockets datagram or streaming?

I'm trying to harden a java-websocket server against DoS attacks by limiting incoming message size. I found this great Q&A on C sockets' receive buffers (which I presume is the way to limit size since I cannot find anything else). In it, it says…
user1382306
2
votes
1 answer

Problem with java socket, won't listen for more than one datagram package

I'm creating a server(now called Server1) which is communicating with another server i've got(now called Server2). Server1 sends a datagrampackage to Server2. Server2 is supposed to send two datagram packages back, but i only get one back. Server2…
Ikky
  • 2,826
  • 14
  • 47
  • 68
2
votes
0 answers

Android Video Streaming Using DatagramSocket setPreviewCallback

I've made an application that obeys UDP using Datagram Socket in android. I'm trying to use Camera's setPreviewCallback function to send bytes to a (c#) client, using Datagram Socket; But, The problem is : it throws an exception "The datagram was…
2
votes
0 answers

Adding a breakpoint in ecliipse on read/write to a particular [IP Address]:port

There are many processes that will write to some channels.Is there a way to add a breakpoint whenever read/write happens on a particular [IP address]:port or any [IP address]:port. Adding a watchpoint on the channel variable is not useful because…
rakesh99
  • 1,234
  • 19
  • 34
2
votes
0 answers

Preposterous Datagram length

While testing my program, I got incredibly strange errors. The program is written in C++ and uses SDL, and SDL_TTF. I'm programming in Netbeans on a Mac OSX 10.7.5. I was running the program from the Netbeans console, so all prints and couts are…
2
votes
2 answers

Java byte to string

So I want to convert a byte array returned by the DatagramPacket's getData() function into a string. I know the way to convert the whole byte array to string is just: String str = new String(bytes); However, this prints out null characters at the…
Richard
  • 5,840
  • 36
  • 123
  • 208
2
votes
1 answer

How to make the client listens to the data sent from the server

I want to send data from one client to another client through the server using DatagramSocket class. The server receives data from the clients , add the clients port number and names in an array list , but does not send the data to destination…
user2752385
  • 83
  • 10
2
votes
1 answer

sending data from one client to another using DatagramPacket

I'm making a simple server_client application using the Datagramsocket and DatagramPacket. what I want to do is: one client sends data to the server and the server sends these data to another client . The problem is server recieves the data from the…
user2752385
  • 83
  • 10
2
votes
1 answer

Why different DatagramSocket constructors behave so different? (BindException)

I'm building a program that will connect every computer in my LAN to my computer, through DatagramSocket's and DatagramPacket's (in other words, I'll be the server and the others will be clients). I made some research and read the documentation, and…
dvaccam
  • 61
  • 6
2
votes
1 answer

Use datagrams in java to send video/audio from client to server?

Hey everyone, I'm having a bit of a problem with UDP and Datagrams. I'm supposed to make a server that will get a request from the client to send a file in the same directory. The UDP Server will then get this file (a video), put it into a…
Patrick C
  • 739
  • 3
  • 12
  • 25
2
votes
1 answer

Reassemble udp messages with node.js

I'm just getting started with node.js and UDP. I'm trying to capture UDP packets and then format the output. The UDP packet's I'm receiving are being split up in to multiple messages. I can't figure out how to reassemble the message. I can…
2
votes
1 answer

send continous bytes[] data into DatagramSocket,DatagramPacket in java

I'm making a java desktop application, where I'm recording voice from the mic and in LAN real time want to send this voice data to another computer system and vice-verse. I'm able to record sound though mic and out to speaker in my system. Now using…
gauravds
  • 2,931
  • 2
  • 28
  • 45
2
votes
1 answer

Video file packets over UDP -- incremental read and stream

I would like to transfer a video file read from disk to a receiver using UDP DatagramPacket in Java. The key points are as follows: though the file to be transmitted is read from disk, I should assume that I'm not aware of the file size. The total…
arun
  • 137
  • 3
  • 10
2
votes
1 answer

Android application not receiving UDP packets

The server is on the PC: sendData = "server msg here".getBytes(); DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, ipAddr, portNb); try { sendSock.send(sendPacket); Thread.sleep(1000); …