How can I stop reply from WCF service WebServiceHost

51 Views Asked by At

I have a WCF WebServiceHost with WebHttpBinding.

I don't want to reply to IPs that are not whitelisted to hide the presence of the service, rather than answering with a 404 error.

I have tried without success:

OperationContext.Current.Channel.Close() / Abort()

Throw New InvalidOperationException()

Kill the thread but no new connection can be established

My service behavior is set to

InstanceContextMode.PerSession
ConcurrencyMode.Single

Any idea?

0

There are 0 best solutions below