From: Peter Olcott on

"Ersek, Laszlo" <lacos(a)caesar.elte.hu> wrote in message
news:Pine.LNX.4.64.1004091445300.25979(a)login01.caesar.elte.hu...
> On Fri, 9 Apr 2010, Rainer Weikusat wrote:
>
>> The main problem of FIFOs is that they are not suitable
>> for anything except 1:1 communication because there is
>> neither a way to determine which of possibly many
>> processes wrote a particular sequence of bytes nor [...]
>
> I apologize for splitting hairs and parroting banalities,
> but if all producers agree to write only messages not
> bigger than _POSIX_PIPE_BUF (== 512) bytes, then those
> messages will be atomic, in a portable way, and a single
> consumer can parse the stream. This enables n-to-1
> communication. (Admittedly, not a very general kind.)
> Messages may carry a fixed length header, designating the
> complete (or remaining) length of the message, and
> identifying the sender.
>
> lacos

Yes, exactly what I am proposing.
Would there be any advantage to using some form of sockets
instead of named pipes?


From: Rainer Weikusat on
"Peter Olcott" <NoSpam(a)OCR4Screen.com> writes:
> "Ersek, Laszlo" <lacos(a)caesar.elte.hu> wrote: in message
>> On Fri, 9 Apr 2010, Rainer Weikusat wrote:
>>> The main problem of FIFOs is that they are not suitable
>>> for anything except 1:1 communication because there is
>>> neither a way to determine which of possibly many
>>> processes wrote a particular sequence of bytes nor [...]
>>
>> I apologize for splitting hairs and parroting banalities,
>> but if all producers agree to write only messages not
>> bigger than _POSIX_PIPE_BUF (== 512) bytes, then those
>> messages will be atomic, in a portable way, and a single
>> consumer can parse the stream.

[...]

> Yes, exactly what I am proposing. Would there be any advantage to
> using some form of sockets instead of named pipes?

The disadvantage of using AF_UNIX sockets is that 'opening' would be
more complicated. Apart from that, there would be only advantages

- message size not limited to PIPE_BUF
- bidirectional
- if datagram-based sockets are used, neither framing nor
parsing are necessary to extract messages from a bytestrem
- kernel provides sender and recipient addresses automatically
- replies can use the same socket(s) as requests
From: Peter Olcott on

"Rainer Weikusat" <rweikusat(a)mssgmbh.com> wrote in message
news:871veowe2j.fsf(a)fever.mssgmbh.com...
> "Peter Olcott" <NoSpam(a)OCR4Screen.com> writes:
>> "Ersek, Laszlo" <lacos(a)caesar.elte.hu> wrote: in message
>>> On Fri, 9 Apr 2010, Rainer Weikusat wrote:
>>>> The main problem of FIFOs is that they are not suitable
>>>> for anything except 1:1 communication because there is
>>>> neither a way to determine which of possibly many
>>>> processes wrote a particular sequence of bytes nor
>>>> [...]
>>>
>>> I apologize for splitting hairs and parroting
>>> banalities,
>>> but if all producers agree to write only messages not
>>> bigger than _POSIX_PIPE_BUF (== 512) bytes, then those
>>> messages will be atomic, in a portable way, and a single
>>> consumer can parse the stream.
>
> [...]
>
>> Yes, exactly what I am proposing. Would there be any
>> advantage to
>> using some form of sockets instead of named pipes?
>
> The disadvantage of using AF_UNIX sockets is that
> 'opening' would be
> more complicated. Apart from that, there would be only
> advantages
>
> - message size not limited to PIPE_BUF
> - bidirectional
> - if datagram-based sockets are used, neither
> framing nor
> parsing are necessary to extract messages from a
> bytestrem
> - kernel provides sender and recipient addresses
> automatically
> - replies can use the same socket(s) as requests


Can this work for TCP sockets too?


From: Ian Collins on
On 04/10/10 08:48 AM, Peter Olcott wrote:
> "Rainer Weikusat"<rweikusat(a)mssgmbh.com> wrote:

[formatting fixed]

>> The disadvantage of using AF_UNIX sockets is that 'opening' would be
>> more complicated. Apart from that, there would be only advantages
>>
>> - message size not limited to PIPE_BUF
>> - bidirectional
>> - if datagram-based sockets are used, neither framing nor
>> parsing are necessary to extract messages from a bytestrem
>> - kernel provides sender and recipient addresses automatically
>> - replies can use the same socket(s) as requests
>
> Can this work for TCP sockets too?

Can what work? There's quite a list there!

--
Ian Collins
From: Peter Olcott on

"Ian Collins" <ian-news(a)hotmail.com> wrote in message
news:829k8rF5njU6(a)mid.individual.net...
> On 04/10/10 08:48 AM, Peter Olcott wrote:
>> "Rainer Weikusat"<rweikusat(a)mssgmbh.com> wrote:
>
> [formatting fixed]
>
>>> The disadvantage of using AF_UNIX sockets is that
>>> 'opening' would be
>>> more complicated. Apart from that, there would be only
>>> advantages
>>>
>>> - message size not limited to PIPE_BUF
>>> - bidirectional
>>> - if datagram-based sockets are used, neither
>>> framing nor
>>> parsing are necessary to extract messages from
>>> a bytestrem
>>> - kernel provides sender and recipient addresses
>>> automatically
>>> - replies can use the same socket(s) as requests
>>
>> Can this work for TCP sockets too?
>
> Can what work? There's quite a list there!
>
> --
> Ian Collins

Can I use TCP sockets as the kind of sockets that I am using
for IPC?


First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8
Prev: Flushing file writes to disk with 100% reliability
Next: SPAM