I am trying to read a stream from the beginning of a json object until the end of a json object, without reading until the end of the stream. This is specifically meant for things like deserializing a TcpClient's NetworkStream where the stream will not close until I have sent a response and the other end closes. Currently, calling
JsonSerializer.Deserialize(stream
JsonSerializer.Deserialize(stream
will not return until the other end calls
TcpClient.Close()
TcpClient.Close()
which means I can't get the full request object and therefore can't send a response that the other end is waiting for.