broadcast

How to make activity react to local Broadcasts while paused?

不羁岁月 提交于 2019-12-07 18:10:42
问题 What is the best way to make an activity (if there is any) react to a broadcast that was send over a LocalBroadcastManager while the activity was paused or stopped. I couldn't find much details if the LocalBroadcastManager differs from a normal broadcast, but it seems that is still gets called event if the activity is in background. But that leads to some problems since some UI modifications are not possible as long as the activity is not shown. That's why I would prefer to handle all

Remoting server auto-discovery. Broadcast or not?

眉间皱痕 提交于 2019-12-07 12:02:59
问题 I have a client/server application that communicates with .Net remoting. I need my clients to be able to find the server(s) on the network without requiring client-side configuration. As far as I know, there is no support for discovery in remoting. I am prepared to implement a UDP solution where the clients will be able to find the servers via broadcast messages. I want to hear the collective SO wisdom before I go ahead. Is this the best way? Any other suggestions? 回答1: I've looked at both

Android Receive UDP broadcast from C# desktop app over LAN?

不羁岁月 提交于 2019-12-07 09:05:33
问题 I'm trying to create a sever application on PC for many android devices using the same wi-fi network. The devices will find the server's IP by receiving UDP broadcast from it contains the server IP data. I've started by creating a sample udp broadcaster in C# and udp receiver in java but I never managed to get the packet on the android side . here is the code : C#: UdpClient listener = new UdpClient(listenPort); IPEndPoint groupEP = new IPEndPoint(IPAddress.Broadcast, listenPort); listener

How to listen for Windows broadcast messages in .NET?

梦想与她 提交于 2019-12-07 05:46:33
问题 i have an Object (i.e. not a form) that wants to listen for broadcast messages from Windows, e.g.: WM_SETTINGCHANGE WM_DWMCOLORIZATIONCOLORCHANGED WM_DWMCOMPOSITIONCHANGED WM_THEMECHANGED WM_POWERBROADCAST What is the mechanism in .NET to setup a non-WinForm's window, that can listen for broadcast messages? i.e. Is there a WindowsListener class? Bonus Chatter In the olden days, in other development environments, the framework provided an AllocateHwnd function: HWND listener = AllocateHWnd

How to listen for broadcast packets on any port?

北战南征 提交于 2019-12-07 05:28:44
问题 Using .NET, how can I listen to udp broadcast packets sent to .255 on any port without the need of binding to a specific port? 回答1: I found a way myself. This is how it works: mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP); mainSocket.Bind(new IPEndPoint(IPAddress.Parse("192.168.0.1"), 0)); mainSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.HeaderIncluded, true); byte[] byTrue = new byte[4] { 1, 0, 0, 0 }; byte[] byOut = new byte[4] { 1, 0,

Broadcast messages in celery

寵の児 提交于 2019-12-07 04:54:43
问题 I'm using celery and want to send broadcast task to couple of workers. I'm trying to do it like is described on http://docs.celeryproject.org/en/latest/userguide/routing.html#broadcast so I create simple app with task: @celery.task def do_something(value): print value and in app I made: from kombu.common import Broadcast CELERY_QUEUES = (Broadcast('broadcast_tasks'), ) CELERY_ROUTES = {'my_app.do_something': {'queue': 'broadcast_tasks'}} and then I was trying to send task to workers with: my

android : detect the reinstall of an app from the app code

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 04:54:16
问题 Is there a way to detect from app code when it is being reinstalled. I saw that app update from market can be detected by listening to PACKAGE_REPLACED event in broadcast receiver. But that these events are not delivered to the app , if the app is reinstalled from editor (eclipse ). My requirement is that i am disabling a component(Launcher activity). The app install will fail if it is not enabled. SO everytime before reinstall i want to enable this component. I am talking about the reinstall

Receiving response(s) from N number of clients in reply to a broadcast request over UDP

风流意气都作罢 提交于 2019-12-07 01:57:03
问题 I am implementing a kind of IP finder for a particular type of network multimedia device. I want to find out all the alive devices of that type in the LAN, with their IP address and other details. The device has its own way of device discovery. It works as follows: A client sends a broadcast request over the LAN via UDP. The destination port number is fixed. In reply, all the servers in the LAN that understand the format of this request will respond to this request providing information about

How are custom broadcast events implemented in JavaScript (or jQuery)?

故事扮演 提交于 2019-12-06 21:08:22
问题 I want to implement a custom event that can be "broadcast", rather than sent to specific targets. Only those elements that have registered themselves as listeners for such events will receive them. What I have in mind would look as follows. First, in various places of the code, there would be statements of the form some_subscriber.on_signal( 'some_signal', some_handler ); I'm using the term signal as shorthand for "broadcast event". In the expression above, some_subscriber registers itself as

Broadcasting UDP packets using multiple NICs

被刻印的时光 ゝ 提交于 2019-12-06 20:00:53
问题 I'm building an embedded system for a camera controller in Linux (not real-time). I'm having a problem getting the networking to do what I want it to do. The system has 3 NICs, 1 100base-T and 2 gigabit ports. I hook the slower one up to the camera (that's all it supports) and the faster ones are point-to-point connections to other machines. What I am attempting to do is get an image from the camera, do a little processing, then broadcast it using UDP to each of the other NICs. Here is my