WCF: What exactly is IsInitiating doing?

In some places, I see IsInitiating creating a new session. Other places say that he creates a new session only when necessary. What is right?

Just to make it clear, I want me to be able to call IService.Foo three times without creating three sessions.

+3
source share
1 answer

When the function IsInitiiti = true is first called, a session begins through the channel. Future IsInitiating calls = true operations do not start new sessions, they simply become part of an existing session. The session ends after the IsTerminating operation is called (this forces the client to close the channel). No further operations can be called through the channel after the IsTerminating operation returns. These properties give developers control over how they invoke the operation relative to the session lifetime.

Sorry, here is the link to the source.

+3
source

Source: https://habr.com/ru/post/1705292/


All Articles