<div dir="ltr"><p dir="ltr">Hi, </p>
<p dir="ltr">Can someone give me a working example of using socket.socketpair with gstreamer multisocketsink?</p>
<p dir="ltr">No matter what I try, I get socket timeout event from gstreamer and only one last frame from the read socket. It seams that socketpair blocks reading until writing takes place :( <br></p><p dir="ltr"><br></p><p>My example:</p><p><br></p><p> print 'creating socket for client', self.client_address[0]<br> reader, writer = socket.socketpair()<br> reader.setblocking(False)<br> writer.setblocking(False)<br> while True:<br> data = reader.read(65536)<br> if not data:<br> break<br> self.wfile.write(data)<br> self.wfile.flush()<br></p><p><br></p><p>On gstreamer side:</p><p> <br> client_id = Gio.Socket().new_from_fd(writer.fileno())<br> <br> self.sink.emit("add", client_id)<br> <br> while client_id in self.clients.keys():<br> time.sleep(1)<br> <br> client_id.close()</p><p><br></p><p>What's wrong here?<br></p><p><br></p>
</div>