datagram

UDP multicast group on Windows Phone 8

情到浓时终转凉″ 提交于 2019-11-28 20:46:01
问题 OK this is one I've been trying to figure out for a few days now. We have an application on Windows Phone 7 where phones join a multicast group and then send and receive messages to the group to talk to each other. Note - this is phone to phone communication. Now I'm trying to port this application to Windows Phone 8 - using the 'Convert to Phone 8' feature in Visual Studio 2012 - so far so good. Until I try to test the phone to phone communication. The handsets seem to join the group fine,

Unix Domain Socket: Using datagram communication between one server process and several client processes

佐手、 提交于 2019-11-28 16:13:05
I would like to establish an IPC connection between several processes on Linux. I have never used UNIX sockets before, and thus I don't know if this is the correct approach to this problem. One process receives data (unformated, binary) and shall distribute this data via a local AF_UNIX socket using the datagram protocol (i.e. similar to UDP with AF_INET). The data sent from this process to a local Unix socket shall be received by multiple clients listening on the same socket. The number of receivers may vary. To achieve this the following code is used to create a socket and send data to it

Problems with UDP in windows 10. UWP

故事扮演 提交于 2019-11-28 13:06:59
I am having the following problem: I am communicating 2 different machines in local network with UDP. In one side I have a Windows 7 machine with 4.5 framework installed. I am using the class System.Net with this code: public static void UDPWriter() { Task.Run(async () => { byte[] data = new byte[10000]; IPEndPoint ipep = new IPEndPoint(IPAddress.Pars("192.168.0.16"), 5002); Socket udpClient = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); udpClient.Connect(ipep); while (true) { await Task.Delay(24); string input = packagetosend; data = Encoding.ASCII.GetBytes

Sending packets to 255.255.255.255 by Java DatagramSocket fails

自作多情 提交于 2019-11-28 11:58:17
I'm programming a networking program in java , and I want to send some Packets to 255.255.255.255, but it fails , even when I send them to 192.168.1.255, which according to the output of ifconfig command , is the broadcast address. But when I send them to my mate's IP it works fine. Here's the code to my program : public class StackOverFlow { public static void main(String[] args) { Network net= new Network(); Scanner input= new Scanner(System.in); while(input.hasNext()) net.sendMessage(input.nextLine()); } } I've used DatagarmSocket and DatagramPacket to do so , here's my implementation of

Python socket.error: [Errno 13] Permission denied

二次信任 提交于 2019-11-28 07:02:16
问题 Using Linux and Python, I want to send some data with broadcast: d = b'109u433279423423423' import socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.sendto(d, 0, ('192.168.0.255', 9)) I launch this script under root and get this error: s.sendto(d, 0, ('192.168.0.255', 9)) socket.error: [Errno 13] Permission denied What is wrong? 回答1: You are trying to send to a broadcast address. It is not allowed, see manpage for sendto(2): EACCES (For UDP sockets) An attempt was made to send to

Whats the difference between a socket which is open and a socket which is connected?

≯℡__Kan透↙ 提交于 2019-11-28 03:02:32
问题 The Java Socket class has two methods isClosed and isConnected to check whether the socket is closed or connected respectively. I wanted to know what's the difference between a TCP socket which is only open and a TCP socket which is open and connected, and how is this different from UDP. 回答1: To put things simply, a Socket that is open is a socket that is either waiting for connection or has successfully connected with another Socket . When a socket has been closed , it means that this socket

Why do I get UDP datagrams out of order even with processes running locally?

て烟熏妆下的殇ゞ 提交于 2019-11-28 01:49:43
I'm developing a java interface between a streaming server and a flash client. I noticed that UDP datagrams can reach my interface out of order even if both processes are running locally. Is that normal? I thought that as no datagram has to go through any router or any network device, then that should not be happening. Actually there are no guarantees of ordering and reception about UDP packets, even if they are sent by localhost on localhost. Just because the specification of the protocol doesn't imply anything about it. Since you can't make assumptions on them you should choose to use TCP or

VoIP RTP Streaming from/to server (in Java) to/from android

ε祈祈猫儿з 提交于 2019-11-27 16:09:49
My target is to have a push-to-talk chat app in GSM/UMTS/LTE networks; initially I wanted use multicast addresses and peer-to-peer without overload the server; unfortunatly, after deep investigation, I discovered that multicast is not allowed in GSM/UMTS/LTE networks, therefore I have to use the server in order to bounce the VoIP packets. I' don't like very much this solution because I have to overload the server, but I didn't find any better solution. If you have an alternative solution is very much apprieciated... Therefore I have to send VoIP from an android client to a server (PC), and

Unix Domain Socket: Using datagram communication between one server process and several client processes

大憨熊 提交于 2019-11-27 09:37:02
问题 I would like to establish an IPC connection between several processes on Linux. I have never used UNIX sockets before, and thus I don't know if this is the correct approach to this problem. One process receives data (unformated, binary) and shall distribute this data via a local AF_UNIX socket using the datagram protocol (i.e. similar to UDP with AF_INET). The data sent from this process to a local Unix socket shall be received by multiple clients listening on the same socket. The number of

DatagramPacket to string

本小妞迷上赌 提交于 2019-11-27 07:52:09
问题 Trying to convert a received DatagramPacket to string, but I have a small problem. Not sure what's the best way to go about it. The data I'll be receiving is mostly of unknown length, hence I have some buffer[1024] set on my receiving side. The problem is, suppose I sent string "abc" and the do the following on my receiver side... buffer = new byte[1024]; packet = new DatagramPacket(buffer, buffer.length); socket.receive(packet); buffer = packet.getData(); System.out.println("Received: "+new