* DCCP and GStreamer: File descriptor sharing
@ 2007-11-01 14:26 Łeandro Sales
2007-11-01 17:28 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 2+ messages in thread
From: Łeandro Sales @ 2007-11-01 14:26 UTC (permalink / raw)
To: dccp
Hi all,
I want to share a same socket-fd between two process using dccp.
The gstreamer plugin architecture uses a concept of sink and src (each
one named element), where sink send and src receive data. In this
case, one of then connects and inform the file descriptor to the
other. Then I thought that if I just share the socket_fd the things
will work, but it didn't. I need something like this:
On dccp_server_sink_element:
1 - sock_fd = socket(...); // sock_id = 10 (for instance), sink tell
dccp_server_src_element this value
2 - bind(sock_fd);
3 - listen(sock_fd);
On dccp_server_src_element:
1 - sock_fd = 10 // for the first version I will just pass this value
via set property, but after I will use unix_socket (as suggested by
Arnaldo) to communicate both elements
2 - wrote = send(sock_fd, ...);
In the client side (similar to server side:
On dccp_client_sink_element:
1 - sock_fd = socket(...); // sock_id = 5 (for instance)
2 - connect(sock_fd);
3 - send(sock_fd);
On dccp_client_src_element:
1 - read(sock_fd) // passed by dccp_client_sink_element.
Is there any additional manipulation to enable the sock_fd sharing.
The error show is "Invalid File Descriptor" when I try to use it in
the srcs elements.
Thanks,
Leandro.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: DCCP and GStreamer: File descriptor sharing
2007-11-01 14:26 DCCP and GStreamer: File descriptor sharing Łeandro Sales
@ 2007-11-01 17:28 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2007-11-01 17:28 UTC (permalink / raw)
To: dccp
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1252", Size: 1162 bytes --]
Em Thu, Nov 01, 2007 at 11:26:10AM -0300, Łeandro Sales escreveu:
> Hi all,
> I want to share a same socket-fd between two process using dccp.
> The gstreamer plugin architecture uses a concept of sink and src (each
> one named element), where sink send and src receive data. In this
> case, one of then connects and inform the file descriptor to the
> other. Then I thought that if I just share the socket_fd the things
> will work, but it didn't. I need something like this:
>
> On dccp_server_sink_element:
>
> 1 - sock_fd = socket(...); // sock_id = 10 (for instance), sink tell
> dccp_server_src_element this value
> 2 - bind(sock_fd);
> 3 - listen(sock_fd);
>
> On dccp_server_src_element:
>
> 1 - sock_fd = 10 // for the first version I will just pass this value
> via set property, but after I will use unix_socket (as suggested by
> Arnaldo) to communicate both elements
You _have_ to use unix sockets to pass the fd. fd 10 on one process has
absolutely nothing to do with fd 10 on another process, only if both
were created by the same parent, but from your description it doesn't
seems to be the case.
- Arnaldo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-01 17:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-01 14:26 DCCP and GStreamer: File descriptor sharing Łeandro Sales
2007-11-01 17:28 ` Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox