send a file to multiple device at same time via python&bluez
Question: i want send a file to multiple device at same time via python ... my code :

    
    
    import bluetooth
    from lightblue import *
    import select
    import threading
    
    def send(fileaddress,bladdress,pushport):
        client = obex.OBEXClient(bladdress, pushport)
        client.connect()
        client.put({"name": "test"}, open(fileaddress))
    
    def StartSend(fileaddress,bladdress,pushport):
        t=threading.Thread(group=None,target=send, name=None, args=(fileaddress,bladdress,pushport))
        t.daemon=True
        t.start()
        t.join()
    
    
    class MyDiscoverer(bluetooth.DeviceDiscoverer):
    
        def pre_inquiry(self):
            self.done = False
    
        def device_discovered(self, addr, device_class, name):
            print "%s - %s" % (addr, name)
            serv = bluetooth.find_service(name="OBEX Object Push", uuid=None, address=None)
            pushport = serv[0]['port']
            StartSend('/home/abbas/Desktop/eclipse-standard-kepler-SR2-linux-gtk.tar.gz', addr, pushport)
    
    
        def inquiry_complete(self):
            self.done = True
    
    
    
    
    if __name__ == '__main__':
        d = MyDiscoverer()
        d.find_devices(lookup_names = True)
        readfiles = [ d, ]
        while True:
            rfds = select.select( readfiles, [], [] )[0]
    
            if d in rfds:
                d.process_event()
    
            if d.done: break
    

but when first device detect and start send file to it all python script
paused and wait that sending finish and next start to send another device ...

why ?

i use thread so why pause python process in send step ?

i use this site for these code : <http://people.csail.mit.edu/albert/bluez-
intro/x339.html>

    
    
     To asynchronously detect nearby bluetooth devices, create a subclass of DeviceDiscoverer and override the pre_inquiry, device_discovered, and inquiry_complete methods. To start the discovery process, invoke find_devices, which returns immediately. pre_inquiry is called immediately before the actual inquiry process begins, and inquiry_complete is called as soon as the process completes.
    
    MyDiscoverer exposes a fileno method, which allows it to be used with the select module. This provides a way for a single thread of control to wait for events on many open files at once, and greatly simplifies event-driven programs.
    
    Call process_event to have the DeviceDiscoverer process pending events, which can be either a discovered device or the inquiry completion. When a nearby device is detected, device_discovered is invoked, with the address and device class of the detected device. If lookup_names was set in the call to find_devices, then name will also be set to the user-friendly name of the device. For more information about device classes
    


Answer: The problem is that the `StartSend` function joins the thread, which waits for
the thread to finish. So, creating the thread was pointless. Try using
`multiprocessing.ThreadPool` instead. Its not well documented but works the
same as `multiprocessing.Pool`.

