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

c++ socket - sendto - no data recieved

Visual Studio 2017 Community c++ CLR project It should be sending a UDP datagram to a multicast address. I am sending without errors. -------------- MULTICAST ------------------- 'Project2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mswsock.dll'.…
Jon C.
  • 374
  • 1
  • 4
  • 14
-1
votes
2 answers

No address in DatagramPacket

I am attempting to add a multiplayer form to a simple pong game, but when I try to start the DatagramPacket and try to read the IP and port it says the ip is null and the port is -1. Does anyone know why it would be doing this? I thought maybe it…
-1
votes
3 answers

QT C++ compare received datagram to string

Im trying to compare the data in the received datagram to a string, when i run the program i see that i receive "test", but the if statement doesnt work. #include #include #include #include #include…
p3tter
  • 15
  • 1
  • 7
-1
votes
1 answer

Establish UDP Connection from SWF File

I created a sample application to test UDP speed from my local machine to server. to achieve same i created Action Script Project for Web using Adobe flash Builder where i am unable to get class flash.net.DataGramSocket. and same package is…
Yogesh Prajapati
  • 4,770
  • 2
  • 36
  • 77
-1
votes
2 answers

recvfrom() always return zero remote address

I'm writing a simple udp server application and i ran into an error when i try to get the address of the remote connecting user. while(run == 1) { struct sockaddr_in client_addr; char message[1024]; int len = recvfrom(sockfd, message,…
mateass
  • 105
  • 2
  • 11
-1
votes
3 answers

Compare String with String (Byte array from DatagramPacket)

So I've been asked to create a UDP messaging app. I have two clients that are run from the command line on the same computer, and I am trying to get each client to break out of a while loop when it receives the String "exit" from the other client,…
Dan Flynn
  • 3
  • 4
-1
votes
1 answer

Why multicasting isn't working?

My program doesn't work properly. The problem is that second client can't see messages from the first. I think problem is in while loop. Just not reading from IP adress. Can you help me? Thank you in advance. package multicastchat; import…
ilyablbnv
  • 161
  • 2
  • 10
-1
votes
1 answer

Java UDP Client Not Receiving Packets

I've made a java application which uses UDP and I can't seem to receive packets outside LAN when hosting on my computer. I tried putting my application on a Hosted Server and it seemed to work (receives packet). What is causing this to happen? I…
OrangeD
  • 1
  • 4
-1
votes
1 answer

DatagramSocket and DatagramPacket

I want to broadcast UDP messages in a subnet. My question is, what address should I put in DatagramSocket and what address in DatagramPacket?
Saiful Islam
  • 124
  • 2
  • 14
-1
votes
1 answer

Translate Python into Java

I'm trying to translate a little Python script into Java. It's pretty simple - it sends some data to a UDP port and looks at the result. I'm not a Python guy, and haven't done too much socket programming, but I've figured out the translation of…
Sander Smith
  • 1,371
  • 4
  • 20
  • 30
-1
votes
1 answer

what is the difference between Datagram and P2P?

I am studying about network programming nowadays. So I am a little confused about P2P and Datagram .... what is the difference between these two? I think both of them are connectionless networks. But I know that in P2P (ad hoc) we don't have any…
user3157047
  • 479
  • 5
  • 15
-1
votes
2 answers

unable to receive all datagrampackets

Goodevening everyone. I am trying to create an application using Eclipse(Kepler) where I send an array of DatagramPackets. My server side application is receiving all packets sent by the client. But when the server tries to respond back by sending…
Utsav Jha
  • 366
  • 4
  • 16
-1
votes
1 answer

How do I convert a ByteArray into int via UDP Datagram

My client code: import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.nio.ByteBuffer; import java.util.Scanner; public class UDPClient { public static void main…
Franco
  • 875
  • 1
  • 6
  • 14
-1
votes
2 answers

if statement not working on String from SharedPreference( already tried "==" & ".equals" & ".equalsIgnoreCase")

I recieved the string from arduino using datagram packet and stored the value in my sharedpreference with variable Switch1. byte[] rcvData = new byte[1024]; DatagramPacket rcvPacket = new DatagramPacket(rcvData,…
yhunz_19
  • 1,206
  • 2
  • 12
  • 17
-1
votes
3 answers

Open an UDP channel in java

I want to open an UDP channel between the Client and the server with UDP. I have two questions. When i write DatagramSocket serverSocket = new DatagramSocket(port);; is the channel opened or it will be open when I start sending ? and How can I…
user567
  • 3,712
  • 9
  • 47
  • 80
1 2 3
41
42