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
0
votes
0 answers

Do nodejs dgram udp sockets have limitations?

What I am attempting to do is ingest a lot of logs over UDP using nodejs. I ended up writing a decent bit of code to handle all of this. However, it appears I am losing a lot of the messages being sent over UDP when I am testing. The simple code…
Jeremy Battle
  • 1,638
  • 13
  • 18
0
votes
2 answers

DatagramSocket not throwing SocketTimeout - Java

My datagram socket is not throwing a SocketTimeout despite it being set and I'm not sure how to resolve this. The code is as follows. The thing is, if it doesn't receive any messages along this socket connection, it will timeout on the first run…
0
votes
1 answer

Can't bind DatagramSocket on "0.0.0.0"

in Win RT we have to use DatagramSocket instead of UdpClient. Ok but the following code gives me this error which I don't get on UdpClient. var g = new DatagramSocket(); g.MessageReceived += g_MessageReceived; await…
Peyman
  • 3,059
  • 1
  • 33
  • 68
0
votes
1 answer

Android serialization - java deserialization

I'm having some trouble with sending an Object from my Android app to my Java application. I have a serializable class that's exactly the same. It works perfectly when I send the object from one java appliction to another one using this code on the…
dumazy
  • 13,857
  • 12
  • 66
  • 113
0
votes
2 answers

String sent by DatagramPacket and DatagramSocket is not equals to literal representation of itself

ANSWER IS MY OTHER COMMENT I have a problem, I'm sending user and password String via DatagramPacket and DatagramSocket to a remote machine and I want to do a select statement in a database, but the thing is that the received string appears to be…
J. Arenas
  • 493
  • 1
  • 9
  • 23
0
votes
1 answer

Why is my program hanging on a system.out.print of DatagramPacket.getData()

LinkedList queue = new LinkedList(); for (int i = 0; i < queue.size(); i++) { System.out.println("1: This prints."); System.out.println("2: This doesn't: " + new String(queue.get(i).getData())); int start…
user1848537
0
votes
1 answer

StreamCorruptedException while reading an Object from ByteBuffer

I am using a java NIO Datagram Channel(in blocking mode). I want to transmit an object from one side to the other. This is what I do on the Sender Side: ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream…
Aditya
  • 195
  • 3
  • 4
  • 12
0
votes
1 answer

UdpClient can't receive from DatagramSocket

I am making an application. server side works on desktop and client side works on Windows 8 (Metro App- .Net for Windows Store) here is my server code: var udpServer = new UdpClient(7800); udpServer.BeginRecieve(new AsyncCallback(OnUdpRecieve),…
Peyman
  • 3,059
  • 1
  • 33
  • 68
0
votes
0 answers

How to break down a large text file which is converted into bytes, can be broken down into packets to send over UDP?

public boolean FileToByteArray(DatagramSocket socket, InetAddress dst_addr, int dst_port) throws Exception{ File file = new File("input.txt"); InputStream is = new FileInputStream(file); long length = file.length(); …
Lawrey
  • 1
  • 1
  • 5
0
votes
1 answer

In Android how to know when a DatagramPacket has been received?

Assume that a transmitter is sending DatagramPacket at random intervals. Is there a way to know when a packet is received at the receiver? In C++ and using QT it is possible to connect the socket to a readyRead() signal for…
TJ1
  • 7,578
  • 19
  • 76
  • 119
0
votes
1 answer

udp connecting to device

here is my Code package com.example.messenger; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; import java.net.UnknownHostException; import…
Hayk Nahapetyan
  • 4,452
  • 8
  • 42
  • 61
0
votes
1 answer

UDP DatagramPacket not received from external client

I have a game with a UDP/TCP server and client. One UDP port (2406) for updating the client's location, and one TCP port (2407) for the chat. The problem here is at 2406. When I play the clients in my local network, everything runs fine. But when an…
Stefan Schouten
  • 249
  • 4
  • 14
0
votes
1 answer

Why does java.net.DatagramSocket support a "connected" state?

In reference to this question: What is the background that a java.net.DatagramSocket supports a "connected" state? I would have expected that the isConnected() method always returns false, since UDP/datagram sockets do not support a connected state.…
Andreas Fester
  • 36,091
  • 7
  • 95
  • 123
0
votes
1 answer

How to send files using the c socket api.

I'm having a little issue going from (plain text) stream sockets to "something" that can send files. A month ago I wrote a basic chat client. Now I wish to be able to send and receive a file of any type. Lets go with PDFs or and Image. I'm going to…
L4nce0
  • 67
  • 4
  • 12
0
votes
1 answer

Function hangs? on packet.setAddress()

Ok so the program is designed to take in connections, validate them, and resend that validation code. Before anyone get's angry it's just a simple little project and is not designed to be overly complex haha. However for some very strange reason the…
Bjornke
  • 3
  • 2