What really happens when a person calls the Open method of IRequestChannel? For example, if I have the following code:
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>();
// using a netTcpBinding to a net.tcp://localhost:9999/Bar
IRequestChannel outchannel = factory.CreateChannel();
outchannel.Open(); // what happens here?
if (outchannel.State == CommunicationState.Opened)
{
success = true;
}
outchannel.Close();
I seem to get "false positives" on some services with accurate failures on others. I would assume I'd always get false positives if this didn't in some way verify that the channel was open.
Any suggestions on improvement? I'd like to avoid sending a message since this is just to test a service's viability for a diagnostic test but I can if that's necessary.
I noticed from our configuration file that the channels that return false positives are using the following behaviorConfiguration:
<binding name="secureNetTcpStream" maxBufferSize="2000000" maxReceivedMessageSize="2000000000" transferMode="Streamed" sendTimeout="00:05:00" receiveTimeout="14:00:00">
<readerQuotas maxStringContentLength="2000000000" maxArrayLength="2000000000" />
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" />
</security>
</binding>
I wonder if the streamed behavior configuration is what leads to the IRequestChannel showing it is open even when the host and service are unavailable?