This is exactly what duplex bindings were designed for. The two best choices you have are NetTcpBinding or PollingDuplexBinding.
The former uses a TCP protocol which may not be suitable for your clients if they aren't on your network. However, it does allow two-way communication over a client-initiated socket. So the client doesn't need to be able to accept incoming connections. I recently used this on a project and it works very well. It's also very responsive. When client applications close, the session on the server immediately ends.
The second option, PollingDuplexBinding is included in the Silverlight SDK. It uses a client-initiated "long" HTTP request. The request waits for messages that need to go out to the client and when they arrive, the client request returns. The client then initiates a new HTTP request back to the server. In other words, the client always has a pending HTTP request. This works well over firewalls and should be used when you're dealing with internet clients. However, I've found this to be not as responsive as NetTcpBinding. I may have been doing something wrong but it seemed like attempts to send callbacks to abandoned client sessions took a while to "time out".
Here's an example of the configuration file from my recent project that used NetTcpBinding for duplex communication. Note that other than some tweaks to service throttling I am pretty much using the defaults for this binding. But there's all kinds of things you can tweak such as receiveTimeout, inactivityTimeout, etc.
<configuration>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceThrottling maxConcurrentCalls="65535"
maxConcurrentSessions="65535"
maxConcurrentInstances="65535" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding maxConnections="65535">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<services>
<service name="BroadcastService">
<endpoint address="" binding="netTcpBinding" contract="BroadcastService" />
</service>
</services>
</system.serviceModel>
</configuration>
[ServiceContract( CallbackContract = typeof( IBroadcastCallback ) )]
[ServiceBehavior( ConcurrencyMode = ConcurrencyMode.Multiple )]
public class BroadcastService : IDisposable
{
[OperationContract(IsInitiating=true)]
public long Subscribe( Guid clientID )
{
// clients call this to initiate the session
}
[OperationContract(IsOneWay = true)]
public void Publish( BroadcastMessage message )
{
// client calls this to broadcast a message to
// all other subscribed clients via callback
}
}
[ServiceContract( Name = "BroadcastCallback" )]
public interface IBroadcastCallback
{
[OperationContract( IsOneWay = true, AsyncPattern = true )]
IAsyncResult BeginBroadcast(BroadcastMessage Message, AsyncCallback callback, object state);
void EndBroadcast( IAsyncResult asyncResult );
} // interface