equal
deleted
inserted
replaced
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; |