FAQ Database Discussion Community


Threading an UDP server

python,multithreading,udp,server
I would like to make a multi-threading UDP server in Python. The purpose is to be able to connect several clients to the server (not sockets connections but username and password), act with each of them and do some actions on the server. All at the same time. I am...

Multicast echo server

c,sockets,unix,udp,multicast
This is more of a conceptual confusion. I am making a multicast server which just echoes back the datagram received.Here's the code while (1) { cnt = recvfrom(sock, message, sizeof(message), 0, (struct sockaddr *) &addr, &addrlen); //printf("%d \n",cnt); if (cnt < 0) { perror("recvfrom"); exit(1); } else if (cnt ==...

The meaning of Java's DatagramChannel.write()

java,sockets,network-programming,udp
I recently found code using DatagramChannel.write(). The code only asked for host ip and port before it connected and then would allow sending (via DatagramChannel.write()). Being new to network programming, it seemed odd that it wouldn't request the destination IP/port. Why not? Oracle's documentation states This method may only be...

Calculating the size of utilized Socket Options

sockets,tcp,udp,connection,ip
Why is there not an API for determining what socket options have actually been set? (security? But the local and remote end points are available anyway) Aside from deriving the socket and manually storing the information how can one get all options in use on a socket without iterating over...

c++ UDP socket programming in ubuntu [closed]

c++,sockets,udp
I'm trying to learn udp socket programming in c++ but I can't find a useful tutorial and a useful example code . can anybody help me to find some?

Can't Send data to loopback address from loopback address

windows,sockets,udp,loopback-address
Is it possible to send data from 127.0.0.1:7000 to 127.0.0.1:8000 ? I am getting socket error 10049 which is invalid address. sockaddr_in sin; memset((char*)&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; sin.sin_addr = 16777343; //127.0.0.1 sin.sin_port = 16415;//8000 int _ret = ::sendto(sock, Buff, Len, 0, (sockaddr*)&sin, sizeof(sin)); ...

python graypy simply not sending

python,udp,udpclient,graylog2
import logging import graypy my_logger = logging.getLogger('test_logger') my_logger.setLevel(logging.DEBUG) handler = graypy.GELFHandler('my_graylog_server', 12201) my_logger.addHandler(handler) my_adapter = logging.LoggerAdapter(logging.getLogger('test_logger'), { 'username': 'John' }) my_adapter.debug('Hello Graylog2 from John.') is not working I think the issue is the url that should send to /gelf because when I curl from the terminal to my graylog server...

Designing a high performance network logger solution for a busy server

performance,sockets,networking,design,udp
I have a highly busy server that keep send/receive massive amount of data through the network, we currently write all the server logs to the same file system where the server is installed and that is causing us to get insufficient disk space after only 1 hour, that file system...

Set RTSP/UDP buffer size in FFmpeg/LibAV

ffmpeg,udp,rtsp,buffer-overflow,libav
Note: I'm aware ffmpeg and libav are different libraries. This is a problem common to both. Disclaimer: Duplicate of SO question marked as answered but actually didn't give a proper solution. Insufficient UDP buffer size causes broken streams for several high resolution video streams. In LibAV/FFMPEG it's possible to set...

UDP Broadcast and Receive

java,udp
I have a Java class intended to facilitate connections between computers without the need for explicitly defining peer addresses. import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.MulticastSocket; import java.net.SocketException; public class Broadcasts { private final Runnable receiver; private final Runnable sender; private boolean run = true; public Broadcasts(TheThing parent) {...

Real-time multiplayer game latency compensation

c,lua,udp,enet
To be brief, I am working on a real-time multiplayer game. In my game, the clients send updated position and velocity data to the server at a frequency of 20Hz. In the example code below, I am converting data from a Lua table into a C struct using LuaJIT FFI....

UDP broadcast client in Java

java,sockets,udp
I am using UDP broadcast for interservice communication The server is in Python and I can see the UDP messages using this code: import sys import socket HOST = '' PORT = 9002 s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1) s.setsockopt(socket.SOL_SOCKET,socket.SO_BROADCAST,1) s.bind((HOST,PORT)) while True: try: message = s.recv(8192) print("Got data: " + message)...

If app A listens to the same private port previously used by app B, will app A get app B's public port number?

udp,client-server,port,firewall,nat
If one application listens to the same private port number previously used by another application on that computer, will the more recent app get the same public port number as the less recent app? Application A and Application B both use non-multicast UDP. They both run on a computer that...

what will be done if the buffer socket full

networking,udp,buffer,protocol-buffers
what will be done if the buffer socket full in an UDP protocol? does it replace the old data with the new one? ot it just drop the new data? In case that it's not related with UDP protocols, and it's specified in the code, how to do this in...

Docker: Internal UDP communication

udp,docker
Internal UDP communication seems broken in Docker (version 1.2.0) Steps to reproduce: $ docker run -t -i ubuntu:14.04 /bin/bash [email protected]:/# echo "hello" | nc -l -u 6000 & [email protected]:/# echo "yo" | nc -u localhost 6000 I should see "hello", but I get no response. Same steps works outside of...

MulticastSocket receives message twice

java,android,udp,multicastsocket
I send messages to WIFI Access Point via MulticastSocket and get replies always twice. If I try to send message to me self, I get message twice again. This is my receiver code: protected Void doInBackground(Void... params) { String lText; byte[] lMsg = new byte[GlobalConfig.MAX_UDP_DATAGRAM_LEN]; DatagramPacket dp = new DatagramPacket(lMsg,...

need to choose between NamedPipe or UDP

c#,.net,udp,named-pipes,udpclient
I had an argument with a colleague on the selection. We have two processes running on the same machine. => NamedPipe and UDP are KERNEL OBJECT so as far as i understand this is same overhead. The advantage of UDP is that if tomorrow we will separate those two processes...

Read logs from Logcat without killing the tablet

android,udp,logcat
I have to read the logs from Logcat and send them to a server through UDP. For this task I have used this code: https://github.com/chemik/logcatudp The main problem of that code is that the async Thread that is launched enters a while(true) loop that drains the tablet's battery on the...

udp in android example

java,android,udp
i am using the below code to send text message between two android devices but i could not receive the packet at the receiver side the sender: String messageStr="Hello Android!"; Log.d("note","message prepaered"); int server_port = 12345; try{ Log.d("note","socket prepaered"); DatagramSocket s = new DatagramSocket(); Log.d("note","socket defined"); InetAddress local = InetAddress.getByName(ip.getText().toString());...

C# send video frame

c#,video,udp,frame
I would like to send video frames using UDP connection from the client to server. How do I get the video frame from my webcam? Do I need to save every frame to my computer and from there send it to the server? If i run on 30fps which means...

How is the destination MAC address automatically updated when the destination IP address is geven for an UDP frame in C#

c#,udp,ethernet
I have tried a program shown below:- class Program { static IPEndPoint Mypoint = new IPEndPoint(IPAddress.Parse("10.169.20.30"), 8050); static IPEndPoint UrPoint = new IPEndPoint(IPAddress.Parse("10.169.20.15"), 8051); static UdpClient TxClient; static void Main(string[] args) { int i = 0; byte[] data= new byte[1472]; TxClient = new UdpClient(Mypoint); while (i < 500) { data[i]++;...

Are UDP sockets on Windows falling back to pipes on the same machine?

sockets,winapi,udp,pipe
Not sure whether this is true or not, whether it is platform specific, nor whether if there's a standard that forces an implementation to abide by such a rule, hence the question: If one opens UDP sockets (WINAPI) to establish communication between processes on the same machine, will the communication...

Python TCP programming

python,networking,tcp,udp
I am having a tcp server and a client written in python. The aim of the programs is that the server will be sending some numbers one after the other to the client and the client should process each one of the number in a separate thread. The server loops...

For how long a router keeps records in the NAT and can they be reused forwarding requests from other hosts?

udp,rewrite,router,packet,nat
There is an answer explaining in simple terms how a router works translating requests from the local network to outside and back (http://superuser.com/questions/105838/how-does-router-know-where-to-forward-packet) what is not clear - for how long a record in the NAT is kept? For example, if I send a UDP request to 25.34.11.56:3874 and my...

Java UDP Connection

java,sockets,netbeans,network-programming,udp
I'm using Netbeans IDE trying to make a UDP connection between client and server, it's a simple program that UDPClient send a String to UDPServer and the server capitalize the string and sends it back to the client.I made the client side and server side in a separated projects. my...

Bind in TCP/UDP Sockets

c,sockets,tcp,network-programming,udp
Bind function is used to assign a name (a sockaddr struct) to a socket descriptor. Why is it required for TCP server but not TCP client ? And why it is required for bot UDP Client and server? I have also written correctly working code without using bind() in UDP...

Crash in Android UDP server

android,udp
UPDATED: I get crash in this Android UDP server example: //------------------------------------------------------------ public class AsyncReceiveUdp2 extends AsyncTask<String, Void, Boolean> { @Override protected Boolean doInBackground(String... f_url) { int udp=111; String txt=""; byte[] packet = new byte[2000]; DatagramPacket dp = new DatagramPacket(packet, packet.length); DatagramSocket ds = null; try { ds = new DatagramSocket(udp);...

Why can't I get UPnP unicast M-SEARCH to work instead of MultiCast M-SEARCH?

udp,multicast,upnp,udpclient
Good morning, We've decided to use UPnP as much as possible. We are using MultiCast on 239.255.255.250:1900 for our M-SEARCH. However, we're looking at how to handle when a customer has MultiCast locked down on their network. Looking at the UPnP 1.1 spec, it talks about using a unicast with...

Implementing VOIP over udp, what is the approach to take when the player cannot cope up with received packet's speed

android,audio,udp,voip,rtp
I am implementing p2p voice over IP on android, using UDP, openSL and some audio compression. The voice chat works good when 2 peers are connected, and the lag is steadily about 100ms. When a third peer connects, one or more peer progressively accumulate lag, reaching 15+ seconds in some...

Could a local port be used to connect to multiple remote peers over UDP?

c,sockets,udp
With connect(int socket, const struct sockaddr *address, socklen_t address_len);, according to man 2 connect: The parameter socket is a socket. If it is of type SOCK_DGRAM, this call specifies the peer with which the socket is to be associated; this address is that to which datagrams are to be sent,...

Are there security measures against udp hole punching? [closed]

networking,udp,firewall,nat,hole-punching
I want to establish an UDP communication between two peers, say Alice and Bob. Alice is behind a port restricted cone NAT (so that the same internal port gets mapped to the same external port even if the destination is changed), while Bob is behind a symmetric NAT (which means...

Basic Netty Demo cannot handle TCP and UDP sockets at once

java,tcp,udp,server,netty
I have the following files: https://gist.github.com/anonymous/58c7cf4341acfe83f279 I am aware I can greatly simplify this, I am simply doing this for conceptual reasons. When I run this, only the UDP connection works. When I comment out the UDP, the TCP works fine. Why are both sockets not working at the same...

Boost raw sockets

udp,boost-asio,icmp
I know it is a very theoretical question, but forgive me as this is not my specialty. Looking for an example on how to use raw sockets with boost, I found a question in this same website where it is assured that you cannot know the destination of an UDP...

Importing UDP Multicast signal into Python

python,arrays,struct,udp,multicast
I'm currently trying to import a UDP Multicast signal (an EEG signal) into Python. Although I do get a signal, the output consists of an array of letters, numbers, and symbols which can't be displayed properly, so something is not quite right. Here's my code at the moment: import socket...

Broadcasting UDP message from C# to Python

c#,python,udp,broadcast
I'm trying to send a broadcast message from a C# app on one machine to a Python script on another. If I specify the Python machine's IP as my endpoint, I can send a message just fine. Here's how I'm sending my message: const int PORT = 12345; using (var...

Reinjecting modified packets in netfilter module

c++,linux,udp,iptables,netfilter
I have used netfiler_queue to create a NFQUEUE module for iptables that handles all outgoing UDP packets. I want to modify all UDP packets that match a certain pattern, and reinject them into the network. Here is some example code: ... static int Callback( nfq_q_handle *myQueue, struct nfgenmsg *msg, nfq_data...

Implementation of custom message logger for windows : reports 10049 when ntwk cable unplugged

c,sockets,networking,udp
Trying to develop a simple/small syslog server for windows. This implementation is just to store LOGS in the same machine from 2 other processes of same machine. Wanted this to be similar to LINUX implementation.Started to use UDP DATAGRAM to send data between processes. It is working as expected. However,...

How to parsing message with same struct from udp packet?

c#,struct,binary,udp
My app listening udp port and i receiving some message with this struct. Struct entry: { long price; char type; char flag; int amount; long time; } and i receiving binary message, but how i can parsing? I know about unsafe method, but to me, it is not appropriate. I...

With Java DatagramSockets, can I connect two different sockets to the same local port but on different local addresses?

java,sockets,udp
With Java DatagramSockets, can I connect two different sockets to the same local port but on two different local addresses? I have this situation. My computer has a WiFi card and an ethernet cable connected. The Wifi and the Ethernet are both working and they have two different addresses ("192.168.10.104"...

Network Service Discovery on Windows Phone

c#,network-programming,udp,windows-phone-8.1
I was looking to write a simple desktop app and a corresponding mobile app, the scenario would be: I run the desktop app on my laptop I run the mobile app on my Lumia (on the same wifi network) The phone app somehow finds and connects to the desktop app...

Iptables from udp to tcp [closed]

tcp,udp,port,iptables
Is it possible to convert all outgoing udp traffic from a gateway router to tcp on the same port with iptables. Have looked at mangle but unsure how I can use that.

Stopping UDP packets from being partially chopped off when receive buffer is almost full

c++,sockets,udp,buffering
I'm working on implementing the sliding window protocols in C++ for an assignment. I am using UDP (SOCK_DGRAM) sockets. Occasionally, the program must send a large number of packets (as large as the window size) back to back. So far, I have not increased the window size past 30, but...

Unable to transmit the audio bytes from Mic over network

java,udp,byte,buffer,audio-streaming
I tried recording data from the mic as bytes ans sending to the java UDP server. But the server only plays white noise. I think I have no issue with Server. I have difficult in transmitting the recorded bytes to the server. Here is my code public class Mic {...

Cannot sniff UDP packets in C without Wireshark running

c,linux,sockets,udp,wireshark
I have a setup that looks like this: Target ---- Switch ---- Switch ---- Windows computer | Linux computer So I have a target connected to a switch it sends out UDP-packets for debug purpose. Normally these packets goes to a Windows computer for analysis, this works. I have now...

Does INADDR_ANY interfaces include VMware Network Adapter?

c,sockets,udp,vmware,iptables
My code is currently making use of INADDR_ANY, I am testing to see if I am able to send packets from a VM client through a Ubuntu router, [using IPTables] to my host machine. I am able to ping the Host machine from the client behind the Linux router and...

MQTT-SN over UDP

udp,mqtt,mosquitto
I am trying to connect arduino to my laptop (Ubuntu) as a MQTT-SN client. Arduino is connected to Ubuntu over serial port. I need help in connecting MQTT-SN to mosquitto broker. Is there any opensource tool that can act as a bridge between Serial and mosquitto broker?

UDP payload length and packet transmission

networking,header,udp,packet,payload
I have data 1245 MB for trasmission via UDP over IPv4. For calculation of expected number of packet transmission from A to B then B relay to C, if the data transmitted in blocks of size 320bytes (i.e; payload = 320bytes), and header is 20 bytes, do we minus 20...

UDP and TCP always use same IP for one client?

python,sockets,networking,tcp,udp
I've made a server (python, twisted) for my online game. Started with TCP, then later added constant updates with UDP (saw a big speed improvement). But now, I need to connect each UDP socket client with each TCP client. I'm doing this by having each client first connect to the...

I can't figure out how to enter the recvfrom parameters in this UDP daytime client

c,udp,client
I'm making a simple UDP daytime client. I'm getting this when I try to compile. I've tried casting these to see if they would work but that doesn't lead anywhere. How should I go about entering these parameters with what I have (or am I missing something that should be...

UDP client does not receive data without bind()

c,sockets,udp,winsock2,udpclient
I refereed to the UDP client program from binarytides and I was able to send a UDP packet frompy PC to the UDP server which is My embedded device and this device echoes back a UDP message. In this PC-UDP client code it is expected to get the echoed message...

transfer file over udp

java,c#,sockets,udp
I am trying to transfer file from a java client to a c# server over UDP. However, when i try to open the transfered file(png picture) on the server side it doesn't succeed open it. Someone please can help me? The client code:(java) import java.io.File; import java.net.DatagramPacket; import java.net.DatagramSocket; import...

Slow to send camera images via UDP

android,python,camera,udp,raspberry-pi2
I am trying to stream images from a Camera on my Raspberry Pi via UDP. I'm receiving / displaying them on an Android device. According to my calculations, my application sends at a maximum rate of 10fps, but I need 25 fps. Does anyone know how to speed my solution...

Receiving large UDP packet fails behind Linux firewall using C#

c#,sockets,ubuntu,udp,firewall
I was successfully using this code on my home computer - please note that I have minified the code in order to only show the important parts Socket Sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); // Connect to the server Sock.Connect(Ip, Port); // Setup buffers byte[] bufferSend = ...; // some...

Chrome UDP sockets not receiving from remote machine

javascript,sockets,google-chrome,udp,google-chrome-app
I'm working on a Google Chrome app that contains the following code: var socket = chrome.sockets.udp; var PORT = 5005; var HOST = '127.0.0.1'; socket.create({}, function(sockInfo){ socket.bind(sockInfo.socketId, HOST, PORT, function(result){ socket.onReceive.addListener(function(info){ // do stuff with the packet data }); }); }); This mechanism worked perfectly when I was sending data...

How do I know which UDP packets I have already received?

networking,udp,client-server
I am making a game using a client-server model with UDP. Here's how I have implemented it so far: All packets include a sequence number and a flag specifying whether they are "important". Important message types require acknowledgement and will be re-sent after a delay if no acknowledgement is received....

sendto() + recvfrom() buffer confusion Datagram

sockets,udp
Confused about a concept... Suppose if the client call sendto() twice, each time sending datagram of 100 bytes to the server. Then if the server call recvfrom() with a receive buffer of 200 bytes, will it be receiving both datagrams into the same buffer? From what I learn.. if i...

Socket Programming in Python

python,sockets,udp
I am working on a proof of concept using python that emulates a server/client communication using sockets to send UDP packets. I can easily do a simple client to server and back to client comms, but I am trying to introduce a "middle-man" into that communication. Conceptually the problem can...

UDP receiving - precise time when packages arrive in C#

c#,sockets,udp,timestamp,udpclient
Is there way to know precise time when packages arrives to buffer with UDP protocol in C# (windows 7)? I tried somethings like this: while(true) { UDPclient.Receive(ref remoteEp); Console.WriteLine(System.DateTime.Now.TimeOfDay.ToString()); } I got wrong result. Some of packages arrive very close, some too far from each other. Wireshark gives correct timestamp,...

How to access UDP Server using external IP Address

c#,.net,udp,server
I have the following UDP server listening on Port 11000: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Net.Sockets; namespace UDPServer { class Program { static byte[] dataToSend = new byte[] { 1, 2, 3, 4, 5 }; // get the ip and port number where the...

Send file part by part with UDP

java,android,udp
I would send a XML file splitted into N parts in my server side. Each files contains at start this informations : fileNumber and totalPart For example if I have 32 parts : - the first file contain at start : 0 (file number) and 32 (total parts) - the...

Multiple socket 'handshaking' in UDP network using SFML C++ libraries

c++,sockets,network-programming,udp,sfml
I am coding a real-time, network program with UDP protocol using SFML libraries. The server will be handling all of the processing, sending packets to the client and vice versa. I need a method to synchronize the screen updates, because there will be a real-time user interface on both sides...

can we open an UDP conection in javascript

javascript,sockets,udp
I think all is in the title, I want to use socket in js with UDP. I tried with WebSocket but : Uncaught SyntaxError: Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. 'udp' is not allowed. Is it possible with socket.io ? if yes how...

FFmpeg UDP timeout, retrying with TCP callback

ios,tcp,ffmpeg,udp,rtsp
I'm reading some RTSP stream in an iOS app using FFmpeg. If the firewall or other services stops the network from receiving via UDP, FFmpeg nicely falls back to reading via TCP. My question is: How can I be notified that the fallback to TCP happened? I need to know...

When packet drop occurs in a link with VoIP and TCP working concurrently?

networking,tcp,udp,voip,packet-loss
Let's assume TCP Reno version I have this situation: a VoIP (UDP) stream and a TCP session on the same host. Let's say at t=10s the TCP opens the session with the TCP receiver (another host), they exchanges the max window during the 3-way handshake and then they start the...

Erlang network programming TCP and UDP messages v packets

tcp,network-programming,erlang,udp
Consider the following: {ok, ListenSocket} = gen_tcp:listen(Port, [binary, {packet, 4}, {reuseaddr, true}, {active, once} ]), {ok, AcceptSocket} = gen_tcp:accept(ListenSocket), receive {tcp, Socket, Bin} -> case binary_to_term(Bin) of {store, Value} -> Uid = kvstore:store(Value), send(Socket,Uid); {retrieve, Key} -> send(Socket,kvstore:retrieve(Key)) end end (The send fun closes the socket). I'm assuming that the...

UDP messaging service

java,sockets,udp,ip-address,datagram
I have to create a program that will send and receive messages to/from a remote IP address. So basically it should simulate a messaging service. In the program, you must enter the an IP address and the data will be sent to that specific address. Currently, I can send but...

Get IP of remote client sending to socket

.net,sockets,asynchronous,network-programming,udp
How can I get the IP of the sending remote client when using the .NET Socket class with BeginReceive and EndReceive? I'm only able to retrieve the sent data, but not the IP address of the sending client. Pseudo code sample shortened and without error handling for brevity: this.Socket =...

Recombining several DatagramPackets into a single byte[]

java,udp,bytearray,datagram
Preface: I am NOT experienced at all and have likely made silly mistakes. Please correct these mistakes and teach me how to be better instead of berating me for being ignorant, if I wasn't already humbled by my lack of knowledge, I wouldn't need to ask for help. I have...

Not getting onReceive callback for UDP socket on chrome after event page is unloaded

javascript,sockets,google-chrome,udp,google-chrome-app
I am creating a chrome app (packaged) and I have to create a UDP socket and listen for the incoming broadcast messages as soon as chrome browser starts up. Everything works fine as I start browser , I get the callback registered through chrome.sockets.udp.onReceive.addListener() API and the data as well....

when would a blocking socket.send() block? (UDP)

sockets,udp,send,blocking
I have been reading about UDP sockets in python. By default a socket is configured so that sending or receiving data blocks, stopping program execution until the socket is ready. Calls to send() wait for buffer space to be available for the outgoing data, and calls to recv() wait for...

Passing a struct from client to server using UDP sockets in C

c,sockets,udp
How do you pass a structure from the UDP client to the UDP server in C using sockets? How can you access the variables that structure contains on the server? If the structure below is transmitted, how does the server see what the name or age is? struct animal {...

Efficiently send a stream of UDP packets

c++,sockets,networking,udp
I know how to open an UDP socket in C++, and I also know how to send packets through that. When I send a packet I correctly receive it on the other end, and everything works fine. EDIT: I also built a fully working acknowledgement system: packets are numbered, checksummed...

How should I pick which source specific multicast address to use?

udp,multicast,ipv4
"The 232.0.0.0/8 (IPv4) and FF3x::/32 (IPv6) block is reserved for use by source-specific multicast." So I assume this means I can use any address from 232.0.0.0 to 232.255.255.255 for source-specific multicasting. What should I be considering when I choose which address to use?...

What's the practical limit for the data length of UDP packet?

sockets,udp,ip
This is wikipedia's explanation of the length field of the UDP header: Length A field that specifies the length in bytes of the UDP header and UDP data. The minimum length is 8 bytes because that is the length of the header. The field size sets a theoretical limit of...

Need a UDP client example

php,udp
I have a Sail Timer wind vane that transmits data via UDP over a WiFi network created by the wind vane hardware. The system works fine, and I can read the data via 3rd party INavX navigation software. But I want to be able to read the UDP stream directly...

Detecting incoming port for TFTP data?

c,sockets,udp,tftp
I'm working on implementing a TFTP client (UDP socket). Currently I have to switch off the entire firewall on my Windows 8 machine or else the data doesn't reach the TFTP client. The outgoing connect request happens on port 69, but the first data packet from the TFTP server is...

Ruby get UDPSocket port number

ruby,sockets,udp
I am trying get the port number after I have bind my UDPSocket to a free port number. so udp_server = UDPSocket.new udp_server.bind('localhost', 0) So I am passing a 0 here to let udp_server randomly pick a free port number for me. Is it possible to get the port number...

how to spoof outgoing UDP socket port number in linux?

linux,sockets,udp
The question is the title. But I'd like to describe my problem so that someone can suggest an alternative solution. I know that when the client sends a message on a socket to 12.34.56.78:40, the router on the client's side sets a rule for some time that any data received...

Missing line in “Follow UDP Stream” in wireshark

udp,wireshark,gnuradio
I am streaming raw UDP packets (rf data) from GNU Radio to Octave (or any other program). The data consists of 390625 4 byte floats per second. This is 1562500 bytes per second. When GNU Radio streams UDP, there is no header or sequence number in the UDP data, it's...

Losing data with UDP over WiFi when multicasting

udp,broadcast
I'm currently working a network protocol which includes a client-to-client system with auto-discovering of clients on the current local network. Right now, I'm periodically broadsting over 255.255.255.255 and if a client doesn't emit for 30 seconds I consider it dead (then offline). The goal is to keep an up-to-date list...

Receive UDP Packets on Google Compute Engine

java,networking,udp,port,google-compute-engine
my task is to receive UDP packets on an Google Compute Engine. Given is the port, which is 300 and I already have a simple Java program which can handle these UDP packets. My problem now. Get the UDP packets to my Java program. For that I don't know how...

C# - UdpClient.Send broadcasts to right AND wrong interface

c#,networking,udp,broadcast,ipv4
I have two interfaces IF-A:10.0.0.1 and IF-B:172.20.29.152. Sending broadcasts to both interfaces should generate 2 packets: var udp = new UdpClient(); var target1 = IPAddress.Parse("10.255.255.255"); var target2 = IPAddress.Parse("172.20.255.255"); udp.Send(new byte[0], 0, new IPEndPoint(target1, 80)); udp.Send(new byte[0], 0, new IPEndPoint(target2, 80)); I ran wireshark and saw that 4 Packets went...

app get stuck at serverSocket.accept() and gives bind exception address already in use on the second call for the thread

java,android,sockets,tcp,udp
I have two problems with an app that i have built for socket communication, first I'll try to explain what the app does and then I'll go into the details of those two problems. First I click on a button, which starts a thread, which sends a multicast massage "group...

Process UDP packet by two clients connected to IPAddress.Any and 127.0.0.1

.net,sockets,f#,udp,udpclient
I'm trying to connect two UdpClients to one port so they read the data in parallel and handle the requests in two separate queues. But for some reason only one of the clients receives the packets. let listen (local:IPEndPoint) = async { use client = new UdpClient() client.ExclusiveAddressUse <- false...

Error correcting codes for packet loss (UDP)

c++,math,udp,protocols,error-correction
I have no real idea what to look for, since all I get with "Error correcting codes" is stuff related to cases where you don't know the location of the error. Thus those codes are much more complicated an inefficient than I need them to be. In the following, note...

Unable to exchange UDP packets with node.js AWS server

node.js,sockets,amazon-web-services,network-programming,udp
I would like to use my AWS instance to exchange UDP packets with various client applications. When I run the server-side code locally, everything works as expected. However, when the code is run from AWS, I can only receive packets, not send. The logs tell me that, at least, the...

Are the C functions recvfrom and sendto mutually exclusive?

c,linux,sockets,udp,thread-safety
I have one thread calling recvfrom with a timeout of 100 ms in a loop. Another thread calls sendto periodically. Does the sendto function wait until the recvfrom is released by the timeout (or a successful read) or does it send the data during that period of time....

UDP Socket: How to determine when the available bytes are a full datagram

c#,.net,sockets,udp
I have a .NET Socket (System.Net.Sockets.Socket) which I want to use for UDP (connectionless communication). I want to receive datagrams with polling, that is, I want to call the Available method to check whether a datagram is available. If it is, I call Receive to receive it without blocking. If...

receiving UDP data in PC that send by hardware,

delphi,udp,delphi-xe,indy10,hardware-interface
I've developed a hardware (client,src ip 192.168.01.200 :9652, des ip 192.168.01.100 :9652) that reply ARP and ICMP request from pc and send UDP frame, i can check the UDP frame , ARP and icmp reply in wireshark and all of these frames are ok but i can't receive anything in...

how to perform ssdp communicationbetween upnp devices

udp,wireshark,upnp,icmp,ssdp
i am trying to implement the upnp level communication between the devices .. but facing problem in getting the response message .and more over on sending the ssdp:discovery multicast not able to recieve the messages from the devices ... please guide me through i am completely newto this topic pre-requisite...

TCP and UDP combined [closed]

sockets,networking,tcp,udp
I am planning on using TCP/IP and UDP protocols together for my game server. I have alread setup the server, in java, and the client, in c++, and had them both connected with a nice gui using the TCP/IP protocol. I need their to be UDP interactions since the UDP...

Java UDP datagram packet - slicing data to suit buffer size

java,sockets,network-programming,udp,client-server
in Java, UDP datagram packets uses a fixed size of byte array to send and receive streams through the network. if the data I want to send is bigger than the buffer how to slice the data to suit the datagram packet ? if data is sliced at the client...

DatagramChannel Send Missing On Wire

java,udp,arp
I'm seeing some occasional missing data with a datagram channel in a tool I'm developing. UDP is part of the requirement here, so I'm mostly just trying to troubleshoot the behavior I'm seeing. The tool is being developed with Java 7 (another requirement), but the computer on which I'm seeing...

PHP socket_recvfrom free resources

php,sockets,udp
I have a UDP daemon written in PHP receiving data from remote UDP devices. $sock = socket_create(AF_INET, SOCK_DGRAM, 0); socket_bind($sock, 0, $port) or die('Could not bind to address'); while (true) { $r = socket_recvfrom($sock, $buf, 65535, 0, $remote_ip, $remote_port); echo "$remote_ip : $remote_port -- " . $buf ."\n"; echo strlen($buf)...

A firewall for Android with VpnService. Responses are delivered, but a SocketTimeoutException is thrown

android,sockets,networking,udp,firewall
I am implementing a simple firewall for Android using VpnService. My app is similar to ToyVpnService, but it doesn't send raw IP packets to a remote VPN server which would forward them to their destinations. My implementation is here: https://bitbucket.org/MaksimDmitriev/norootfirewall/src/006f7c33cd1cd4055f372ed3a88664fe2a4be3dd/src/com/norootfw/NoRootFwService.java?at=unix Can I do all this forwarding routine locally? That's what...

send udp message from PC(windows)(client) to android phone(server) not working

android,multithreading,udp
I want to send a UDP message from PC(server) to my android phone 4.2(client) using WIFI connection. My phone and PC are connected via wireless router. But no message is received from phone to mobile. I have understood from debugging that the program is waiting at socket.receive(packet);. So, there is...

Golang UDP Server only recieving locally sent packets

linux,go,network-programming,udp
I've written a UDP Server in Go(listens on port 666), and it seems to be only receiving packets that were sent locally. To confirm traffic, I have been using: sudo tcpdump -n udp dst port 666 My(abbreviated) server code: import "net" func startServer() { // Bind the port. ServerAddr, err...

Multi-client UDP server python

python,sockets,udp
I would like to implement an UDP server with Python. I want to be able to wait for some clients to connect and chat with others at the same time. I tried to use an SocketServer implementation import SocketServer class MyUDPHandler(SocketServer.BaseRequestHandler): def handle(self): data = self.request[0].strip() socket = self.request[1] print("{}...

Message queuing protocols: PGM vs UDP

udp,message-queue,multicast
I need to have an intelligent conversation with several co-workers who have not yet been sold on embracing tried and trusted message queuing libraries such as MSMQ, ZeroMQ, RabbitMQ, etc and we need this type of messaging in our solution. But to be able to sell to my colleagues the...

Two multicast streams sharing the same group address

linux,udp,multicast
I see two different multicast streams with the same group address 226.a.b.c, but different ports A and B, arriving at my machine. I need only one of those (A for example). So I bind my socket to 226.a.b.c:A and do a join request with setsockopt IP_ADD_MEMBERSHIP Now I expect to...