1

I'm currently working on a service that involves client callback over netTcpBinding. However, I can't find answers to the following two questions:

  1. When a client invokes the service, what is the client's address that will be used for callback?
  2. How can I programmatically change this address before the client invokes the service?

I understand that when working with wsDualHttpBindings, there is a property called clientBaseAddress that can be used to set the client address. However, netTcpBinding doesn't have a similar property?

  • `NetTcpBinding` is duplex out of the box. `wsDualHttpBinding` is actually two HTTP channels - one from the client to the service and one from the service to the client (for callbacks), which is why there is a `clientBaseAddress` for `wsDualHttpBinding`. It's not needed for truly duplex channels. – Tim Jan 14 '14 at 08:12

1 Answers1

1

netTcpBinding is bi-directional, so you don't need to do anything to specify the client's address.

The reason you have to specify it for wsDualHttpBinding is because that binding establishes 2 HTTP channels (since HTTP isn't bi-directional) - one for the client to the service, and the second one for the service to the client.

So to answer your questions:

  1. The address that will be used for the callbacks is the address of the client.

  2. You don't need to change the callback address with netTcpBinding. Indeed, you wouldn't want to change it for wsDualHttpBinding either - I think you meant how would you set it in code, and in this case you can't and don't need to.

Tim
  • 28,212
  • 8
  • 63
  • 76
  • In case if either the connection is closed or either the client or service crashes, is it possible to reestablish the connection *only* when the service needs to use the callback? – user3186786 Jan 14 '14 at 15:41
  • I'm not sure I understand the question, but if you mean you can turn the connection on and off as needed for callbacks, I would think most likely not. NetTcpBinding is bi-directional so the callback "ability" is always there, whether its used or not. Note also that the client initiates the connection - the service cannot initiate the connection simply to send the callback. – Tim Jan 14 '14 at 20:07