anchor.diff:  open System.Collections.Generic
   open System.IO.Compression
   
  -type SendStreamState =
  -    {
  -        sendStream :    ByteStream
  -    }
  -
  -module SendStreamState =
  -
  -    let create () =
  -        {
  -            sendStream = new ByteStream (Array.zeroCreate <| 1024 * 1024)
  -        }
  -
  -    let write (msg : 'T) f (state : SendStreamState) =
  -
  +[<Sealed>]
  +type SendStreamState private (bs : ByteStream) =
  +
  +    member __.Write (msg : 'T, f) =
           match Network.lookup.TryGetValue typeof<'T> with
           | true, id ->
  -            let sendStream = state.sendStream
  -
  -            let startIndex = int sendStream.Position
  +            let startIndex = int bs.Position
   
               let pickler = Network.FindTypeById id
  -            sendStream.Writer.WriteByte (byte id)
  -            pickler.serialize (msg :> obj) sendStream.Writer
  -
  -            let size = int sendStream.Position - startIndex
  -
  -            f state.sendStream.Raw startIndex (int size)
  +            bs.Writer.WriteByte (byte id)
  +            pickler.serialize (msg :> obj) bs.Writer
  +
  +            let size = int bs.Position - startIndex
  +
  +            f bs.Raw startIndex (int size)
   
           | _ -> ()
   
  -type ReceiveStreamState =
  -    {
  -        receiveStream : ByteStream
  -    }
  -
  -module ReceiveStreamState =
  -
  -    let create () =
  -        {
  -            receiveStream = new ByteStream (Array.zeroCreate <| 1024 * 1024)
  -        }
  -
  -    let rec read' (subscriptions : Event<obj> []) (state : ReceiveStreamState) =
  -        let reader = state.receiveStream.Reader
  +    member __.Reset () =
  +        bs.SetLength 0L
  +
  +    static member Create () =
  +        SendStreamState (new ByteStream (Array.zeroCreate <| 1024 * 1024))
  +
  +[<Sealed>]
  +type ReceiveStreamState private (bs : ByteStream) =
  +
  +    let read (subscriptions : Event<obj> []) =
  +        let reader = bs.Reader
           let typeId = reader.ReadByte () |> int
   
           if subscriptions.Length > typeId && typeId >= 0 then
  
positive.code:     member this.ServerSend<'T> (msg : 'T, packetType, endPoint) =
          match udp with
          | Udp.Server state ->
              state.sendStreamState
              |> SendStreamState.write msg (fun bytes startIndex size ->
                  this.ServerSend (bytes, startIndex, size, packetType, endPoint)
              )
          | _ -> ()
  
negative.code:     let create (udpServer : IUdpServer) endPoint heartbeatInterval time =
  
          let packetPool = PacketPool 1024
          let sendStreamState = SendStreamState.Create ()
          let receiveStreamState = ReceiveStreamState.Create ()
  
          let basicChannelState =
              BasicChannelState.Create (packetPool,
                  (fun packet ->
                      receiveStreamState.Write (packet.Raw, sizeof<PacketHeader>, int packet.DataLength)
                  ),
                  (fun packet -> udpServer.Send (packet, endPoint))
              )
  