Connection PrepareRequest(IMessage msg, ref ITransportHeaders requestHeaders) { string url = (string)msg.Properties["__Uri"]; string objectID; Manager.Parse(url, out objectID); if (objectID != null) { requestHeaders["__RequestUri"] = objectID; } else { requestHeaders["__RequestUri"] = url; } Connection connection = Connection.GetConnection(server, channel, channel.TcpKeepAliveEnabled, channel.TcpKeepAliveTime, channel.TcpKeepAliveInterval, channel.MaxRetries, channel.RetryDelay); System.Diagnostics.Debug.Assert(connection != null, "Manager.GetConnection returned null", "Manager.GetConnection returned null in ClientTransportSink.ProcessMessage for server - " + server); IPEndPoint localEndPoint = (IPEndPoint)connection.Socket.LocalEndPoint; requestHeaders["__IPAddress"] = localEndPoint.Address; return(connection); }