broadcast

How to ignore your own broadcast udp packets

六月ゝ 毕业季﹏ 提交于 2019-11-27 06:48:08
问题 For the following I'm assuming one network card. I have a component of my program which is designed to let others in the subnet know of its existence. For this, I've implemented a solution where whenever the program starts up (and periodically afterwards) it sends a broadcast to INADDR_BROADCAST - whoever listens on the required port will remember where it came from for later use. The problem with this is that I don't want to remember my own broadcasts. I thought that in theory this would be

Sending packets to 255.255.255.255 by Java DatagramSocket fails

情到浓时终转凉″ 提交于 2019-11-27 06:38:44
问题 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

Can I use broadcast or multicast for TCP?

核能气质少年 提交于 2019-11-27 05:47:26
问题 For Internet Protocol (IP) I can use multicast : in IPv4: Internet Group Management Protocol (IGMP) in IPv6: Multicast Listener Discovery Also, in example, for UDP I can use: broadcast - to send packet to range of addresses multicast - to send packet to list of specified addresses But can I use something of these for TCP? 回答1: No, you can't. TCP is a protocol for communication between exactly two endpoints. Compared to UDP it features reliable transport, that means, that packets get not only

Broadcast receiver not working in ICS if the app is not started atleast once

a 夏天 提交于 2019-11-27 05:16:57
This question has been asked few times in stack overflow, but no solution, yet. I have a broadcast receiver for for receiving USB connected action.The broadcast receiver responsibility is , if I get the intent start my application.In the manifest file I have added the receiver . I have the same logic working in GingerBread, but I ICS its not working. Many questions like , broadcast-not-invoking 1 : Android Boot-Up BroadCast Not invoking and broadcastreciever-not-working If I start my app manually once, then from next time on-wards when USB is connected my App starts automatically. tries to

Broadcast to Icecast / SHOUTcast with Objective-C, C, or C++

一曲冷凌霜 提交于 2019-11-27 04:33:59
I want to provide audio data into SHOUTcast or Icecast servers without using their own broadcaster, since i will be using this on various platforms including mobile. I need protocol descriptions, open source projects, or samples to be able to send audio data (from mic or file) using Objective-C, C or C++ to SHOUTcast and Icecast servers. Where can I find the information needed to build a proper SHOUTcast/Icecast source client? Comment: It's about time someone makes a SHOUTcast source client for mobile. I've been needing this for a while, but don't have time to build it, so kudos to you. Please

Send Broadcast UDP but not receive it on other Android devices

旧巷老猫 提交于 2019-11-27 04:18:05
问题 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

Detect screen on/off from iOS service

梦想与她 提交于 2019-11-27 03:54:19
I am developing a network monitor app that runs in background as a service. Is it possible to get a notification/call when the screen is turned on or off? It exists in Android by using the following code: private void registerScreenOnOffReceiver() { IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON); filter.addAction(Intent.ACTION_SCREEN_OFF); registerReceiver(screenOnOffReceiver, filter); } screenOnOffReceiver is then called when screen is turned on/off. Is there a similar solution for iOS? Edit: The best I've found so far is UIApplicationProtectedDataWillBecomeUnavailable (

Is broadcasting via TCP possible?

半腔热情 提交于 2019-11-27 03:52:04
问题 I'm writing a server/client system in C, which uses BSD Sockets under a TCP connection. The server is multi-threaded, with each connection running in its own receptor. Each client does a good job talking with the server on a one-to-one basis, sadly I can't think of a way to implement a SendToAll() function, for instance, if client A does something that requires sending a packet to all of the clients. How would I do this? I was considering implementing a queue in every receptor, and any

How to broadcast intent with extras through ADB shell?

旧巷老猫 提交于 2019-11-27 02:47:40
问题 I am trying to send the BATTERY_CHANGED intent through the ADB shell. So far I only managed to send the intent with no information: am broadcast -a android.intent.action.BATTERY_CHANGED I created an app witch listens for this intent and here is what the system sends every few seconds: #Intent;action=android.intent.action.BATTERY_CHANGED;launchFlags=0x60000010;i.icon-small=17302838;B.present=true;i.scale=100;i.level=100;S.technology=Li-ion;i.status=5;i.voltage=4155;i.invalid_charger=0;i

Where is the all Android broadcast Intent list

末鹿安然 提交于 2019-11-27 02:32:20
I want to receive the Android broadcast messages. Is there a list of all intents? batfree I have found the broadcast intent list. It can be located under the sdks(or android-sdks)/platforms//data/broadcast_actions.txt. Thank you. For API level 16 (ICS), this is the list: android.app.action.ACTION_PASSWORD_CHANGED android.app.action.ACTION_PASSWORD_EXPIRING android.app.action.ACTION_PASSWORD_FAILED android.app.action.ACTION_PASSWORD_SUCCEEDED android.app.action.DEVICE_ADMIN_DISABLED android.app.action.DEVICE_ADMIN_DISABLE_REQUESTED android.app.action.DEVICE_ADMIN_ENABLED android.bluetooth.a2dp