anchor.diff:              logger.Debug(sprintf "sending message to %O" ip)
               sendMessage socket buffer
   
  -    // TODO any network connection  that throws an exception
  -    let makeConnectionLoop (box: MailboxProcessor<_>) =
  -        let rec connectionLoop (connections: Dictionary<IPAddress, ConnectionDetails>) =
  -            async { try
  -                        let! msg = box.Receive()
  -                        let deadSockets = 
  -                            connections 
  -                            |> Seq.filter (fun x -> not x.Value.Socket.Connected)
  -                            |> Seq.toList
  -                        for deadSocket in deadSockets do
  -                            connections.Remove(deadSocket.Key) |> ignore
  -                        match msg with
  -                        | Add socket ->
  -                            let cd = ConnectionDetails.Create socket 
  -                            let ip, _ = getRemoteAddress socket
  -                            connections.Add(ip, cd)
  -                            return! connectionLoop connections
  -                        | Remove socket -> 
  -                            // TODO this could fail, try removing by socket reference if it does
  -                            let ip, _ = getRemoteAddress socket
  -                            connections.Remove ip  |> ignore
  -                            return! connectionLoop connections
  -                        | Broadcast buffer ->
  -                            let sockets =
  -                                connections.Values |> Seq.map (fun x -> x.Socket) |> Seq.toArray
  -                            broadcast sockets buffer
  -                            return! connectionLoop connections
  -                        | SendMessage (address, buffer) ->
  -                            let succes, socket = 
  -                                connections.TryGetValue(address) 
  -                            match succes with
  -                            | true -> sendMessage socket.Socket buffer
  -                            | false -> logger.Error(sprintf "failed to send message to %O" address)
  -                            return! connectionLoop connections
  -                    with ex ->
  -                        logger.Warn(sprintf "SAVED event loop from %O" ex)
  -                        // TODO check if it's network excpetion and remove socket
  -                        return! connectionLoop connections }
  -        connectionLoop
  -
  -    let activeSendConnections =
  -        MailboxProcessor.Start(fun box ->
  -                                    let connectionLoop = makeConnectionLoop box
  -                                    connectionLoop (new Dictionary<IPAddress, ConnectionDetails>()))
  -
  -    let sendMessageTo address messageBuffer =
  -        activeSendConnections.Post(SendMessage(address, messageBuffer))
  -
  -    let startReadLoop socket =
  +    let startReadLoop (activeConnections: MailboxProcessor<_>) socket =
   
           let rec processSegements header (segments: ResizeArray<byte[]>) =
   
  
positive.code:     | Remove of Socket
      | Broadcast of byte[]
      | SendMessage of IPAddress * byte[]
  
  type MessageReceivedEventArgs(address: IPAddress, message: Message) =
      inherit EventArgs()
  
negative.code: 
      do messageProcessor.MessageReceived |> Event.add handleMessage
  
      member x.Connect() =
          startAcceptLoop() |> Async.Start
          activeConnections.Start()
  
      member x.Broadcast message =
          let buffer = messageProcessor.CreateBufferWithHeaderFromMessage message
          activeConnections.Post(Broadcast buffer)
  
      member x.SendTo address message =
          let buffer = messageProcessor.CreateBufferWithHeaderFromMessage message
  