public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Duplicating Unix Domain Sockets
@ 2002-06-03 13:52 David E Euresti
  2002-06-03 13:59 ` Christopher Faylor
  2002-06-03 23:17 ` egor duda
  0 siblings, 2 replies; 12+ messages in thread
From: David E Euresti @ 2002-06-03 13:52 UTC (permalink / raw)
  To: cygwin

Allright.  So I have two solutions.
(And tell me if I should direct this to the folks at cygwin-devel)

#1
Make cygwin be able to implement the Ancillary data as in 4.3+BSD as
described in section 15.3.3 in Advanced Programming in the Unix
Environment.

To implement this, I would tag all messages sent on Unix domain sockets
with a tag like this:
struct tag {
	int adatalen; // Length of ancillary data
	int rdatalen; // Length of real data
}

Then when you receive it your first read the tag and if there is ancillary
data read it and do what you need to do (convert the info into an fd) and
then read the rdatalen.  If there is more rdatalen than the length of
buffer sent to you, you return what you can, and remember how much is
left.

This is obviously a big task, and opinions would be quite welcome.

#2
Just add a function that says, create_fd_from_handle_plus were I can
pass in all the parameters that the sending process could send, and so
that the same file descriptor gets created.  The problem with this is that
getting the info from one process to another (IPC?) is up to the
programmer.

As you can tell I really want to pass file descriptors between cygwin
processes.  I think from a networking standpoint it's useful.  Now for all
I know somebody else has done this already (possibly doing something
easier), please let me know.

Thanks,
David


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: Duplicating Unix Domain Sockets
@ 2002-06-03 15:19 David E Euresti
  2002-06-03 17:01 ` Bob Friesenhahn
  0 siblings, 1 reply; 12+ messages in thread
From: David E Euresti @ 2002-06-03 15:19 UTC (permalink / raw)
  To: cygwin

I'm not so sure that it'll make it that much slower. I mean we are talking
of adding only a couple of bytes to every send Unix Domain sockets.  And
Unix domain sockets never go outside the computer.  Obviously it'll hurt
if your program usually sends small packets, but you'll gain in being able
to pass file descriptors through there.

But I would like to hear what the original developer has to say.

David


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Duplicating Unix Domain Sockets
@ 2002-06-03 12:37 David E Euresti
  2002-06-03 12:42 ` Christopher Faylor
  0 siblings, 1 reply; 12+ messages in thread
From: David E Euresti @ 2002-06-03 12:37 UTC (permalink / raw)
  To: cygwin

Hello,
	So I've been working on this passing file descriptor between
processes thing. And I've gotten something that works well.  I'm using
cygwin_attach_handle_to_fd to create the file descriptor.  Unfortunately I
can't seem to see how to create a Unix Domain socket (AF_UNIX) using this.
I've traced through all the source and can't seem to find the place to do
it.

	I've also heard talk that the cygserver can be used to pass file
descriptors.  But I can't find the information to do it.

Thanks,
David


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2002-06-05 16:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-03 13:52 Duplicating Unix Domain Sockets David E Euresti
2002-06-03 13:59 ` Christopher Faylor
2002-06-03 23:17 ` egor duda
2002-06-04  5:41   ` Robert Collins
2002-06-05 12:30     ` David E Euresti
2002-06-04  8:07   ` David E Euresti
2002-06-04  8:33     ` egor duda
2002-06-04  8:40       ` David E Euresti
  -- strict thread matches above, loose matches on Subject: below --
2002-06-03 15:19 David E Euresti
2002-06-03 17:01 ` Bob Friesenhahn
2002-06-03 12:37 David E Euresti
2002-06-03 12:42 ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).