Livt packages

Livt.Web

Version 1.0.0

Bounded HTTP routing, request parsing, response encoding, and Ethernet application composition for Livt.

Published files (63)

src/http/HttpTcpSequence.lvt

namespace Livt.Web.Http

using Livt.Net

/**
 * Narrow adapter helper: unsigned sequence advancement in network byte order.
 */
class HttpTcpSequence
{
	/**
	 * count is a validated payload length (or one SYN), not arbitrary signed data.
	 */
	public static inline fn Advance[](sequence: uint, count: int) byte[4]
	{
		// One unsigned addition wraps at 32 bits; shifts only select network-order bytes.
		var advanced = sequence + (count as uint)
		var result: byte[4]
		result[0] = (advanced >> 24) as byte
		result[1] = (advanced >> 16) as byte
		result[2] = (advanced >> 8) as byte
		result[3] = advanced as byte

		return result
	}
}