Edit

Share via


AuthenticatedStream.IsServer Property

Definition

Gets a Boolean value that indicates whether the local side of the connection was authenticated as the server.

public abstract bool IsServer { get; }

Property Value

true if the local endpoint was authenticated as the server side of a client-server authenticated connection; false if the local endpoint was authenticated as the client.

Examples

The following example demonstrates displaying the value of this property.

// The following class displays the properties of an authenticatedStream.
public class AuthenticatedStreamReporter
{
    public static void DisplayProperties(AuthenticatedStream stream)
    {
        Console.WriteLine("IsAuthenticated: {0}", stream.IsAuthenticated);
        Console.WriteLine("IsMutuallyAuthenticated: {0}", stream.IsMutuallyAuthenticated);
        Console.WriteLine("IsEncrypted: {0}", stream.IsEncrypted);
        Console.WriteLine("IsSigned: {0}", stream.IsSigned);
        Console.WriteLine("IsServer: {0}", stream.IsServer);
    }
}

Remarks

Most security protocols used for client-server authentication define specific behavior and requirements for supplying credentials for authentication based on whether you are the client or the server.

Applies to