CqlSharp.Protocol.FrameReader.ReadInetAsync C# (CSharp) Method

ReadInetAsync() public method

Reads the inet async.
public ReadInetAsync ( ) : Task
return Task
        public async Task<IPEndPoint> ReadInetAsync()
        {
            byte length = await ReadByteAsync().AutoConfigureAwait();

            if(!TryGetSegmentFromBuffer(length))
                await ReadSegmentAsync(length).AutoConfigureAwait();

            byte[] address = CopySegmentToArray();
            var ipAddress = new IPAddress(address);

            int port = await ReadIntAsync().AutoConfigureAwait();

            var endpoint = new IPEndPoint(ipAddress, port);

            return endpoint;
        }