broadcast

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

99封情书 提交于 2019-12-05 08:05:51
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 themselves. I am broadcasting the UDP request message using sendto(). Now my problem is that I don't

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

会有一股神秘感。 提交于 2019-12-05 03:29:15
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 a listener of one type (called 'some_signal') of such signals, by providing a handler for it.

Receive UDP in Android Marshmallow

爱⌒轻易说出口 提交于 2019-12-05 01:37:34
问题 I'm having problems to receive constantly the UDP packets from the server with new Nexus 5X (Marshmallow) I have another real devices that receive all UDP packets, but it seems that something changed in Android API 23. CODE: Anyone with the same problem? if (s == null || s.isClosed()){ Log.v("udp", "----------------------------------------------------new socket---------------------------------"); s = new DatagramSocket(null); s.setReuseAddress(true); s.setBroadcast(true); s.setSoTimeout(5000)

How can I send a notification message from server to all clients in WCF (broadcast you can say)?

泄露秘密 提交于 2019-12-05 01:31:04
问题 I want to send notification message every second from net tcp WCF service to all clients, Broadcast you can say? After the helpful answers I wrote the following method that will send notifications (heartbeat) to all connected users foreach (IHeartBeatCallback callback in subscribers) { ThreadPool.QueueUserWorkItem(delegate(object state) { ICommunicationObject communicationCallback = (ICommunicationObject)callback; if (communicationCallback.State == CommunicationState.Opened) { try { callback

Broadcasting UDP packets using multiple NICs

谁说我不能喝 提交于 2019-12-05 00:03:39
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 network configuration: eth0: addr: 192.168.1.200 Bcast 192.168.1.255 Mask: 255.255.255.0 (this is the

C# UDP broadcast client/server does not work

只愿长相守 提交于 2019-12-04 21:45:14
I'm using .NET 2.0 and have created a fairly simple udp broadcast app and UDP listener. Listener code: Socket listener = new Socket( AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp ); IPEndPoint localEndPoint = new IPEndPoint( IPAddress.Any, 11000 ); listener.Bind( localEndPoint ); EndPoint ep = (EndPoint)localEndPoint; Console.WriteLine("Ready to receive…"); byte[] data = new byte[1024]; int recv = listener.ReceiveFrom(data, ref ep); string stringData = Encoding.ASCII.GetString(data, 0, recv); Console.WriteLine("received: {0} from: {1}", stringData, ep.ToString()); listener

Little problem with AsyncUdpSocket receiving data after connecting to broadcast instead of server

有些话、适合烂在心里 提交于 2019-12-04 20:42:43
问题 I have a problem with AsyncUdpSocket. I used to connect to a server, send some data and get some response. Now since I do not know the actual address of the server I had to change my code and send the data to the broadcast address 255.255.255.255. Here is my code : NSString *bchost = @"255.255.255.255"; NSString *host = @"10.1.0.1"; int udpPort = 6001; AsyncUdpSocket *udpSocket = [[AsyncUdpSocket alloc] initWithDelegate:self]; [udpSocket bindToPort:udpPort error:nil]; [udpSocket

Issues with ACTION_HEADSET_PLUG broadcast in Android

纵然是瞬间 提交于 2019-12-04 19:36:57
I've tried these phones: Motorolla Backflip 1.5, Nexus One 2.1 Basically I register BroadcastReceiver to get ACTION_HEADSET_PLUG broadcast and look on 3 extras that come in intent: state name microphone Here is the description from API: * state - 0 for unplugged, 1 for plugged. * name - Headset type, human readable string * microphone - 1 if headset has a microphone, 0 otherwise Issue #1: Broadcast comes when activity is started (not expected), when screen rotation happens (not expected) and when headset/headphones plugged/unplugged (expected). Issue #2: Backflip phone (1.5) sends null for

How to broadcast a function over a numpy array, when dtype=object?

丶灬走出姿态 提交于 2019-12-04 15:34:02
If I have an array of numerical values, which had to use object pointers instead of values as the data type, due to unequal vector lengths: In [145]: import numpy as np In [147]: a = np.array([[1,2],[3,4,5]]) In [148]: a Out[148]: array([[1, 2], [3, 4, 5]], dtype=object) In [150]: np.sin(a) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-150-58d97006f018> in <module>() ----> 1 np.sin(a) In [152]: np.sin(a[0]) Out[152]: array([ 0.84147098, 0.90929743]) How do I broadcast a function over the actual

Android Bluetooth Piconet Broadcast data

杀马特。学长 韩版系。学妹 提交于 2019-12-04 14:33:36
问题 I have some questions regarding Piconet in Android: Is it possible with the Bluetooth Android API to broadcast data that was sent by one slave to all (master and slaves) in the Piconet? If it is possible, how does it work? Does it go to the master first and then to all slaves, or does the slave directly contact other slaves? Can one device connect to two or more different Piconets? If the master is down, can it delegate automatically to other slaves? FYI, I'm using both master and slave on an