src/nvim/os/channel.c
void channel_from_stream(uv_stream_t *stream)
{
  Channel *channel = register_channel();
  stream->data = NULL;
  channel->is_job = false;
  // read stream
  channel->data.streams.read = rstream_new(parse_msgpack,
                                           CHANNEL_BUFFER_SIZE,
                                           channel,
                                           NULL);
  rstream_set_stream(channel->data.streams.read, stream);
  rstream_start(channel->data.streams.read);
  // write stream
  channel->data.streams.write = wstream_new(0);
  wstream_set_stream(channel->data.streams.write, stream);
  channel->data.streams.uv = stream;
}
/// Creates an API channel from a libuv stream representing a tcp or
/// pipe/socket client connection
///
/// @param stream The established connection
Creates an API channel from a libuv stream representing a tcp or
pipe/socket client connection
Creates an API channel from a libuv stream representing a tcp or pipe / socket client connection
void channel_from_stream(uv_stream_t *stream)
{
  Channel *channel = register_channel();
  stream->data = NULL;
  channel->is_job = false;
  channel->data.streams.read = rstream_new(parse_msgpack,
                                           CHANNEL_BUFFER_SIZE,
                                           channel,
                                           NULL);
  rstream_set_stream(channel->data.streams.read, stream);
  rstream_start(channel->data.streams.read);
  channel->data.streams.write = wstream_new(0);
  wstream_set_stream(channel->data.streams.write, stream);
  channel->data.streams.uv = stream;
}
void channel_from_stream ( uv_stream_t * stream ) { Channel * channel = register_channel ( ) ; stream -> data = NULL ; channel -> is_job = false ; channel -> data . streams . read = rstream_new ( parse_msgpack , CHANNEL_BUFFER_SIZE , channel , NULL ) ; rstream_set_stream ( channel -> data . streams . read , stream ) ; rstream_start ( channel -> data . streams . read ) ; channel -> data . streams . write = wstream_new ( 0 ) ; wstream_set_stream ( channel -> data . streams . write , stream ) ; channel -> data . streams . uv = stream ; }
Creates an API channel from a libuv stream representing a tcp or
pipe/socket client connection
Creates an API channel from a libuv stream representing a tcp or pipe / socket client connection
// read stream // write stream