src/Pure/System/system_channel.ML
changeset 54341 e1c275df5522
parent 50800 c0fb2839d1a9
child 54345 fa80d47c6857
equal deleted inserted replaced
54340:18c621069bf8 54341:e1c275df5522
    66     val (in_stream, out_stream) = Socket_IO.open_streams name;
    66     val (in_stream, out_stream) = Socket_IO.open_streams name;
    67     val _ = BinIO.StreamIO.setBufferMode (BinIO.getOutstream out_stream, IO.BLOCK_BUF);
    67     val _ = BinIO.StreamIO.setBufferMode (BinIO.getOutstream out_stream, IO.BLOCK_BUF);
    68   in
    68   in
    69     System_Channel
    69     System_Channel
    70      {input_line = fn () => read_line in_stream,
    70      {input_line = fn () => read_line in_stream,
    71       inputN = fn n => Byte.bytesToString (BinIO.inputN (in_stream, n)),
    71       inputN = fn n => if n = 0 then "" else Byte.bytesToString (BinIO.inputN (in_stream, n)),
    72       output = fn s => BinIO.output (out_stream, Byte.stringToBytes s),
    72       output = fn s => BinIO.output (out_stream, Byte.stringToBytes s),
    73       flush = fn () => BinIO.flushOut out_stream}
    73       flush = fn () => BinIO.flushOut out_stream}
    74   end;
    74   end;
    75 
    75 
    76 end;
    76 end;