broadcast

Sending and Receiving UDP packets

你离开我真会死。 提交于 2019-11-28 00:14:31
The following code sends a packet on port 15000: int port = 15000; UdpClient udp = new UdpClient(); //udp.EnableBroadcast = true; //This was suggested in a now deleted answer IPEndPoint groupEP = new IPEndPoint(IPAddress.Broadcast, port); string str4 = "I want to receive this!"; byte[] sendBytes4 = Encoding.ASCII.GetBytes(str4); udp.Send(sendBytes4, sendBytes4.Length, groupEP); udp.Close(); However, it's kind of useless if I can't then receive it on another computer. All I need is to send a command to another computer on the LAN, and for it to receive it and do something. Without using a Pcap

UDP Broadcast in Java

喜夏-厌秋 提交于 2019-11-27 23:14:51
Morning. I'm pretty new in Java and socket connections but I'm trying to send out a UDP packet/broadcast on 255.255.255.255 on port 8001 to a device. I can get the data to send just fine, however when it comes time to receive the data the connection times out. I have a packet sniffer and I can see the packet send and then the device respond. I'm pretty sure it is a rookie mistake that I'm missing in my code but I've been stuck on it for awhile and any help would be appreciated. m_Socket = new DatagramSocket(m_SERVERPORT); InetAddress address = InetAddress.getByName(m_SERVERIP); m_DataPack =

Android: BroadcastReceiver on application install / uninstall

独自空忆成欢 提交于 2019-11-27 22:31:20
I want to install an apk file and set a broadcast-receiver in order to catch information concerning install status. I have prepared a BroadcastReceiver class : public class newPackageReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.d("DEBUG"," test for application install/uninstall"); } } In the main activity, I first register a new receiver object, then instanciate button for application install. public void onCreate(Bundle savedInstanceState) { ... IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_PACKAGE_ADDED)

Receiving UDP broadcast packets on Linux

纵然是瞬间 提交于 2019-11-27 22:23:43
We have existing software that periodically broadcasts UDP packets to a specific port (7125) on the local subnet (x.x.x.255). We have monitoring software running on HP-UX (11.11) that is able to receive these packets no problem. However, after porting the monitoring software to Linux (RHEL 6.1) we have found that it does not receive the broadcast packets. tcpdump shows the packets arriving at the Linux host, but the kernel does not send them through to our software. I've been using a couple of python 2.x scripts that mimic the socket API calls the monitoring software uses to test different

boost::asio UDP broadcasting

前提是你 提交于 2019-11-27 22:04:49
I want to broadcast UDP messages to all computers in a local network using boost::asio . Working through the examples I came up with try { socket.open(boost::asio::ip::udp::v4()); boost::asio::socket_base::broadcast option(true); socket.set_option(option); endpoint = boost::asio::ip::udp::endpoint( boost::asio::ip::address::from_string("192.168.1.255"), port); } catch(std::exception &e) { } and want to broadcast messages from my queue with while(!queue.empty()) { std::string message = queue.front(); boost::system::error_code ignored_error; socket.send_to( boost::asio::buffer(message), endpoint

Difference between sc.broadcast and broadcast function in spark sql

强颜欢笑 提交于 2019-11-27 18:50:45
问题 I have used sc.broadcast for lookup files to improve the performance. I also came to know there is a function called broadcast in Spark SQL Functions. What is the difference between two? Which one i should use it for broadcasting the reference/look up tables? 回答1: If you want to achieve broadcast join in Spark SQL you should use broadcast function (combined with desired spark.sql.autoBroadcastJoinThreshold configuration). It will: Mark given relation for broadcasting. Adjust SQL execution

How to send and receive broadcast message

天大地大妈咪最大 提交于 2019-11-27 18:42:11
I am trying to pass data between two activities that are inside of tabs. I am trying to use sendBroadcast() . With breakpoints set I never reach onReceive() . Manifest: <activity android:name=".WebResults" android:label="@string/app_name"> <intent-filter> <action android:name="com.toxy.LOAD_URL" /> </intent-filter> </activity> Activity Sender: Intent intent=new Intent(getApplicationContext(),WebResults.class); intent.setAction("com.toxy.LOAD_URL"); intent.putExtra("url",uri.toString()); sendBroadcast(intent); Activity Receiver : @Override public void onCreate(Bundle savedInstanceState) { super

Send Broadcast UDP but not receive it on other Android devices

ぐ巨炮叔叔 提交于 2019-11-27 18:36:36
I am trying to develop an app that sends some broadcast messages and receives some answers from the other android devices. I am having some trouble receiving the UDP messages from the other devices. I should mention that this code worked on Gingerbread but on JellyBean it's not working anymore and I do not know what might be the problem. Here is where I send the broadcast message (I know the other devices listen on port 5000) : private void sendUDPMessage(String msg) { try { DatagramSocket clientSocket = new DatagramSocket(); clientSocket.setBroadcast(true); InetAddress address = InetAddress

Android detecting the touch state from any application

拥有回忆 提交于 2019-11-27 17:01:22
问题 Is it possible to detect touch events from within another application, specifically swipes? I'd like to be able to detect if the user has swiped left or right (even with 2 fingers - but not required). Perhaps there is a service or broadcast I can listen to. or failing that, is there some API perhaps that I can poll say 10 times a second to get the touch state and I can compute the rest (why, I remember writing a mouse driver strobing the COM1 port with IN OUTs in 8086 assembler coded in a TSR

WebRTC - scalable live stream broadcasting / multicasting

痞子三分冷 提交于 2019-11-27 16:40:23
PROBLEM: WebRTC gives us peer-to-peer video/audio connections. It is perfect for p2p calls, hangouts. But what about broadcasting (one-to-many, for example, 1-to-10000)? Lets say we have a broadcaster "B" and two attendees "A1", "A2". Of course it seems to be solvable: we just connect B with A1 and then B with A2. So B sends video/audio stream directly to A1 and another stream to A2. B sends streams twice. Now lets imagine there are 10000 attendees: A1, A2, ..., A10000. It means B must send 10000 streams. Each stream is ~40KB/s which means B needs 400MB/s outgoing internet speed to maintain