udp

How to get data out of network packet data in Java

In C if you have a certain type of packet, what you generally do is define some struct and cast the char * into a pointer to the struct. After this you have direct programmatic access to all data fields in the network packet. Like so : struct rdp_header { int version; char serverId[20]; }; When you get a network packet you can do ...

How/Where to host an UDP based component?

Hi, I´m working on a project that basically will show some data collected from hardware devices through UDP protocol. the first idea of how to do this: implement a winService (to listen and persist the messages) and a wepApp to manage the data, based on .NET platform. I´m confused about if exists the possibility to rent a "windows servi...

UDP send problem on BlackBerry

I am writing network application for Blackberry .This code is correct at simulator but not working at device. When i run my application on simulator, my server recieves the msg but when i run it on handheld, i get Exception (not IOException) that "null". try { byte[] b = msg.getBytes(); dc = (UDPDatagramConnection)Connector.open("dat...

Question about IP Multicasting?

Hi i am on creating streaming application. in that i am using IP Multicasting. Tell me how to validate the client before adding it in the group. is that anything i have to do with IGMP? ...

100% CPU usage in Delphi

I use Indy 9 with Delphi 5. In my application I want to communicate with a network device via UDP. So I use UDPServer comp. in a class which is derived from TThread. When I write similar to the following code then CPU usage is 100%. in the thread : while not terminated do begin if GetMessage(Msg, 0, 0, 0) then begin if Msg.messag...

WSAETIMEDOUT message in Synapse Library

Why I always get WSAETIMEDOUT error in this code : var fUDPBuf: array [1..UdpPacketSize] of byte; {...} UDPSocket := TUDPBlockSocket.Create; UDPSocket.Bind(UDPIP, UDPPort); if UDPSocket.LastError = 0 then Raise EDevFail.Create(Format(SPortFailed, [UDPPort])); while not Terminated do begin BytesRead := UDPSocket.RecvBufferEx(@fUDPBu...

socket_create vs. fsockopen php

The hosting service that I use currently does let me use sockets, probably for good reason on their part. They do, however, let me use fsockopen. I was wondering what the difference is, because some scripts that worked with socket_create and even stream_socket_server, do not work with fsockopen. That said, if fsockopen should work, my co...

Non-blocking UDP I/O vs blocking UDP I/O in Java

Non-blocking TCP/IP SocketChannels and Selector in NIO help me to handle many TCP/IP connections with small number of threads. But how about UDP DatagramChannels? (I must admit that I'm not very familiar with UDP.) UDP send operations don't seem to block even if the DatagramChannel is not operating in blocking mode. Is there really a...

How to do TOS/DSCP in ruby?

How does one set the TOS flags/DSCP flags in Ruby on a UDP/TCP stream (preferably using the Ruby/Sockets library)? ...

How to measure the response time between a server and a client that communicate using the UDP protocol ?

The aim of the test is to check the shape of the network response time between two hosts (client and server). Network response = the round trip time it takes to send a packet of data and receive it back. I am using the UDP protocol. How could I compute the response time ? I could just subtract TimeOfClientRequest - TimeOfClientResponseRe...

creating a UDP packet I can split.

I'm building a simple udp lan chat application in vb.net and I'm wondering how I should split my packets. Each sent packet should have like an id, a username and ip address from where it's coming and maybe also a command part for like join or leave to update my userlist and a text message. I'd like to know what is the easiest way to put...

Listening to a UDP broadcast with threads.

Hi, I'm broadcasting a simple message to ..*.255 (changing to 255 the last part of my ip) and i'm trying to listen to it. the code returns no error but i'm not receiving anything. In wireshark I can see the broacast is sent correctly, but with a different port each time (I don't know if that's a big deal). Here's some parts of my code. ...

Open Source & Cross Platform Multiplayer/Networking Libraries?

While raknet seems fairly interesting and really appealing from a feature-point of view, its licensing terms seem to be possibly troublesome for GPL'ed projects that may be leveraged commercially, something which is explicitly forbidden by the terms of the creative commons license. While there's also opentnl, it doesn't seem to be as a...

Spoofing Java UDP Packets

I am looking to spoof UDP packets using Java. Are there any good Java libraries out there that allow you to create your own RAW SOCKETS? Sorry, forgot the Java stuff. ...

UDP Broadcast on Multihomed Systems

I'm working on a project that discovers/configures remote devices using UDP broadcasts. These devices may not have IP addresses configured yet, at least no to match the network they are connected to. Currently we use a single sendto with a target address of 255.255.255.255. This works fine in most cases but on Vista machines with multipl...

Successive calls to recvfrom() loses data?

I am working on a reliable file transfer program that uses UDP. (for a course in computer networking.) My question is this - well, consider this scenario: Sender has (for example) 12 bytes of data to send. So the sender performs this call: sendto(fd, &buf, 12, 0, (struct sockaddr *)&cliaddr,sizeof(cliaddr)); This sends the 12 bytes...

How to set up a Winsock UDP socket?

I want to create a Winsock UDP socket that only sends data to a client. I want the kernel to choose an available port for me. On the other hand, I want to indicate which local IP to use, since I'm running a few nics. I've tried combing through the maze of socket options, as well as binding with the port in the socket address set to 0 t...

UDP-Broadcast on all interfaces

On a Linux system with a wired and a wireless interface (e.g. 192.168.1.x and 192.168.2.x subnets) I want to send a UDP broadcast that goes out via ALL available interfaces (i.e. both through the wired and the wireless interface). Currently I sendto() to INADDR_BROADCAST, however it seems that the broadcast only is sent through one of t...

How can I send data with PHP to an IP address via UDP?

How can I send data with PHP to an IP address via UDP? How can I recive that data on the other computer? <?php $fp = pfsockopen( "udp://192.168.1.6", 9601, $errno, $errstr ); if (!$fp) { echo "ERROR: $errno - $errstr<br />\n"; } socket_set_timeout ($fp, 10); $write = fwrite( $fp, "kik" ); //$data .= fread($fp,9600); //echo "$data...

Sending and receiving UDP packets between two programs on the same computer

Is it possible to get two separate programs to communicate on the same computer (one-way only) over UDP through localhost/127... by sharing the same port #? We're working on a student project in which we need to send UDP packets containing some telemetry between two computers. The program that generates these packets is proprietary, b...