Search code examples
.netwcfip-addressnettcpbinding

How to get the origin IP of a netTcpBinding call in WCF?


The called method have access to binding-level information like the origin IP address?


Solution

  • You should be able to use this snippet:

    ((RemoteEndpointMessageProperty)OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name]).Address;