[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: socket-port

This page is part of the web mail archives of SRFI 106 from before July 7th, 2015. The new archives for SRFI 106 contain all messages, not just those from before July 7th, 2015.

On 18/06/2013 20:26, John Cowan wrote:
> Sven Hartrumpf scripsit:
>> I fear that an input/output port is not supported in several major Scheme
>> implementations. It would be much better to have 'socket-ports' that
>> returns two values: the input port and the output port.
> I don't agree, because much of the time you want to both read and write
> from a socket, certainly in the dominant client-server paradigm.  So you
> end up wanting to package up the two ports in a single record, and why
> not make that record behave like a port while you are at it?

I simply didn't consider non-R6RS implementations but if socket-ports returns 2 ports how could it be safely implemented? If the ports share the same socket descriptor then closing one port might cause SIGPIPE or something on the other port. (Might be too much detail but just popped up in my mind.)

Takashi Kato
E-mail: ktakashi@xxxxxxxxx