anchor.diff:  open FDCUtil.Main.Regex
   open FDCDomain.MessageQueue
   open FDCLogger
  -
  -// let read_message_async_obs eom_marker  =
  -
  -
   
   // persistency layer
   // this should have no dependencies on Domain
  
positive.code:             let rec loop() = 
                  printfn "Waiting for request ..."
                  let socket = listener.Accept()
  
                  // TODO implement
  
                  loop()
              try loop()
  
negative.code:             let beginSend(b,o,c,cb,s) = socket.BeginSend(b,o,c,SocketFlags.None,cb,s)
              Async.FromBeginEnd(buffer, offset, count, beginSend, socket.EndSend)
  
      let read_message_async_obs buffer_size eom_marker (socket: Socket) ctoken =
          let subject = new Subject<byte[]>()
  
          let rec loop_find_eom loop acc msg = async {
              let i_maybe = Array.tryFindIndex ((=) eom_marker) msg
              match i_maybe with
              | None ->
                  return! loop (msg::acc)
              | Some i ->
                  if i < (msg.Length - 1) then
                      let msg' = 
                          msg.[0..i]::acc
                          |> List.rev
                          |> Array.concat
                      subject.OnNext msg'
                      return! loop_find_eom loop [] msg.[(i+1)..(msg.Length-1)]
                  else
                      let msg' =
                          msg.[0..i]::acc
                          |> List.rev
                          |> Array.concat
                      subject.OnNext msg'
                      return! loop []
          }
  
          let rec loop acc = async {
              let buffer = Array.zeroCreate buffer_size
              let! bytes_read = 
                  try
                      socket.AsyncReceive(buffer, 0, buffer_size)
                  with ex ->
                      subject.OnError(ex)
                      async { return 0 }
              if bytes_read <= 0 then
                  // TODO distinguish between correct completion and error
                  // TODO dispose socket ? 
                  // subject.OnCompleted() 
                  ()
              else 
                  return! loop_find_eom loop acc buffer.[0..bytes_read-1]
          }
          Async.Start(loop [], ctoken)
  
          Observable.asObservable subject
  
      type IRawTransport = 
          inherit IDisposable 
          abstract Received: IConnectableObservable<byte[]>
  