• DataStax Enterprise C# Driver API Documentation

    Show / Hide Table of Contents
    • Dse
      • AggregateMetadata
      • AlreadyExistsException
      • AtomicMonotonicTimestampGenerator
      • AtomicMonotonicWinApiTimestampGenerator
      • AuthenticationException
      • BatchStatement
      • BatchType
      • BigIntegerTypeAdapter
      • BoundStatement
      • Builder
      • BusyPoolException
      • CassandraConnectionStringBuilder
      • ClientOptions
      • Cluster
      • ColumnDesc
      • ColumnTypeCode
      • CompressionType
      • Configuration
      • ConsistencyLevel
      • ConstantReconnectionPolicy
      • ConstantSpeculativeExecutionPolicy
      • CqlColumn
      • CustomColumnInfo
      • DataCollectionMetadata
      • DataCollectionMetadata.SortOrder
      • DCAwareRoundRobinPolicy
      • DecimalTypeAdapter
      • DefaultRetryPolicy
      • Diagnostics
      • DowngradingConsistencyRetryPolicy
      • DriverException
      • DriverInternalError
      • DseCluster
      • DseClusterBuilder
      • DseConfiguration
      • DseLoadBalancingPolicy
      • Duration
      • DynamicCompositeTypeAdapter
      • EC2MultiRegionTranslator
      • ExecutionException
      • ExecutionInfo
      • ExponentialReconnectionPolicy
      • Extensions
      • FallthroughRetryPolicy
      • FixedReconnectionPolicy
      • FunctionFailureException
      • FunctionMetadata
      • Host
      • HostDistance
      • HostsEventArgs
      • HostsEventArgs.Kind
      • HostsEventHandler
      • IAddressTranslator
      • IAuthenticator
      • IAuthProvider
      • IAuthProviderNamed
      • ICluster
      • IColumnInfo
      • IdempotenceAwareRetryPolicy
      • IDseCluster
      • IDseSession
      • IExecutionProfile
      • IExecutionProfileBuilder
      • IExecutionProfileOptions
      • IExtendedRetryPolicy
      • IFrameCompressor
      • IInitializer
      • ILoadBalancingPolicy
      • IndexMetadata
      • IndexMetadata.IndexKind
      • InvalidConfigurationInQueryException
      • InvalidQueryException
      • InvalidTypeException
      • IReconnectionPolicy
      • IReconnectionSchedule
      • IRetryPolicy
      • IsBootstrappingException
      • ISession
      • ISessionState
      • ISpeculativeExecutionPlan
      • ISpeculativeExecutionPolicy
      • IStatement
      • ITimestampGenerator
      • ITypeAdapter
      • KeyspaceMetadata
      • KeyType
      • ListColumnInfo
      • LocalDate
      • LocalTime
      • Logger
      • LoggingRetryPolicy
      • MapColumnInfo
      • MaterializedViewMetadata
      • Metadata
      • MetadataSyncOptions
      • MetricsExtensions
      • MonitorReportingOptions
      • NoHostAvailableException
      • NoneAuthProvider
      • NoSpeculativeExecutionPolicy
      • NullTypeAdapter
      • OperationTimedOutException
      • OverloadedException
      • PlainTextAuthProvider
      • Policies
      • PoolingOptions
      • PreparedQueryNotFoundException
      • PreparedStatement
      • PreparedStatementIdMismatchException
      • ProtocolErrorException
      • ProtocolOptions
      • ProtocolVersion
      • QueryExecutionException
      • QueryOptions
      • QueryProtocolOptions
      • QueryProtocolOptions.QueryFlags
      • QueryTimeoutException
      • QueryTrace
      • QueryTrace.Event
      • QueryValidationException
      • ReadFailureException
      • ReadTimeoutException
      • RegularStatement
      • ReplicationStrategies
      • RequestInvalidException
      • RetryDecision
      • RetryDecision.RetryDecisionType
      • RetryLoadBalancingPolicy
      • RetryLoadBalancingPolicyEventArgs
      • RoundRobinPolicy
      • RoutingKey
      • Row
      • RowSet
      • RowSetMetadata
      • SchemaChangedEventArgs
      • SchemaChangedEventArgs.Kind
      • SchemaChangedEventHandler
      • ServerErrorException
      • Session
      • SetColumnInfo
      • SimpleStatement
      • SocketOptions
      • SSLOptions
      • Statement
      • SyntaxError
      • TableColumn
      • TableMetadata
      • TableOptions
      • TimeUuid
      • TokenAwarePolicy
      • ToManyConnectionsPerHost
      • TraceRetrievalException
      • TruncateException
      • TupleColumnInfo
      • TypeAdapters
      • UdtColumnInfo
      • UdtMap
      • UdtMap<T>
      • UdtMappingDefinitions
      • UnauthorizedException
      • UnavailableException
      • Unset
      • WriteFailureException
      • WriteTimeoutException
    • Dse.AppMetrics
      • DriverAppMetricsOptions
    • Dse.AppMetrics.MetricTypes
      • IAppMetricsCounter
      • IAppMetricsGauge
      • IAppMetricsMeter
      • IAppMetricsMetric
      • IAppMetricsTimer
    • Dse.AppMetrics.MetricValues
      • IAppMetricsHistogramValue
      • IAppMetricsMeterValue
      • IAppMetricsMetricWithValue<T>
      • IAppMetricsTimerValue
    • Dse.Auth
      • DseGssapiAuthProvider
      • DsePlainTextAuthProvider
    • Dse.Auth.Sspi
      • SspiException
    • Dse.Data
      • CqlBatchTransaction
      • CqlCommand
      • CqlConnection
      • CqlDataAdapter
      • CqlParameter
      • CqlParameterCollection
      • CqlProviderFactory
      • CqlReader
    • Dse.Data.Linq
      • AllowFilteringAttribute
      • Batch
      • ClusteringKeyAttribute
      • ColumnAttribute
      • CompactStorageAttribute
      • CounterAttribute
      • CqlArgumentException
      • CqlCommand
      • CqlConditionalCommand<TEntity>
      • CqlDelete
      • CqlFunction
      • CqlInsert<TEntity>
      • CqlLinqNotSupportedException
      • CqlOperator
      • CqlQuery<TEntity>
      • CqlQueryBase<TEntity>
      • CqlQueryExtensions
      • CqlQuerySingleElement<TEntity>
      • CqlScalar<TEntity>
      • CqlToken
      • CqlUpdate
      • IgnoreAttribute
      • ITable
      • PartitionKeyAttribute
      • SecondaryIndexAttribute
      • SessionExtensions
      • StaticColumnAttribute
      • Table<TEntity>
      • TableAttribute
      • TableType
    • Dse.Geometry
      • GeometryBase
      • LineString
      • Point
      • Polygon
    • Dse.Graph
      • Edge
      • Element
      • GraphNode
      • GraphOptions
      • GraphResultSet
      • GraphStatement
      • IEdge
      • IElement
      • IGraphNode
      • IGraphStatement
      • IPath
      • IProperty
      • IVertex
      • IVertexProperty
      • Path
      • SimpleGraphStatement
      • Vertex
    • Dse.Mapping
      • AppliedInfo<T>
      • ColumnMap
      • Cql
      • CqlQueryOptions
      • IColumnDefinition
      • ICqlBatch
      • ICqlQueryAsyncClient
      • ICqlQueryClient
      • ICqlWriteAsyncClient
      • ICqlWriteClient
      • IMapper
      • IPage<T>
      • ITypeDefinition
      • Map<TPoco>
      • Mapper
      • MappingConfiguration
      • Mappings
      • SortOrder
    • Dse.Mapping.Attributes
      • ClusteringKeyAttribute
      • ColumnAttribute
      • CounterAttribute
      • FrozenAttribute
      • FrozenKeyAttribute
      • FrozenValueAttribute
      • IgnoreAttribute
      • PartitionKeyAttribute
      • SecondaryIndexAttribute
      • StaticColumnAttribute
      • TableAttribute
    • Dse.Mapping.TypeConversion
      • DefaultTypeConverter
      • EnumStringMapper<T>
      • NullableEnumStringMapper<T>
      • TypeConverter
    • Dse.Mapping.Utils
      • MemberInfoExtensions
    • Dse.Metrics
      • DriverMetricsOptions
      • IDriverMetrics
      • IMetric
      • IMetricsRegistry<TMetric>
      • NodeMetric
      • NodeMetric.Counters
      • NodeMetric.Gauges
      • NodeMetric.Meters
      • NodeMetric.Timers
      • SessionMetric
      • SessionMetric.Counters
      • SessionMetric.Gauges
      • SessionMetric.Meters
      • SessionMetric.Timers
    • Dse.Metrics.Abstractions
      • IDriverCounter
      • IDriverGauge
      • IDriverMeter
      • IDriverMetric
      • IDriverMetricsProvider
      • IDriverTimer
    • Dse.Search
      • DateRange
      • DateRangeBound
      • DateRangePrecision
    • Dse.Serialization
      • CustomTypeSerializer<T>
      • TypeSerializer
      • TypeSerializer<T>
      • TypeSerializerDefinitions
      • UdtSerializer

    Class SocketOptions

    Options to configure low-level socket options for the connections kept to the Cassandra hosts.

    Inheritance
    System.Object
    SocketOptions
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Dse
    Assembly: Dse.dll
    Syntax
    public class SocketOptions

    Fields

    DefaultConnectTimeoutMillis

    Default value for ConnectTimeoutMillis, 5000ms.

    Declaration
    public const int DefaultConnectTimeoutMillis = 5000
    Field Value
    Type Description
    System.Int32

    DefaultReadTimeoutMillis

    Default value for ReadTimeoutMillis, 12000ms.

    Declaration
    public const int DefaultReadTimeoutMillis = 12000
    Field Value
    Type Description
    System.Int32

    Properties

    ConnectTimeoutMillis

    Gets the number of milliseconds to wait for the socket to connect

    Declaration
    public int ConnectTimeoutMillis { get; }
    Property Value
    Type Description
    System.Int32

    DefunctReadTimeoutThreshold

    Gets the amount of requests that simultaneously have to timeout before closing the connection.

    Declaration
    public int DefunctReadTimeoutThreshold { get; }
    Property Value
    Type Description
    System.Int32

    KeepAlive

    Gets if TCP keep-alive must be used

    Declaration
    public bool? KeepAlive { get; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>

    ReadTimeoutMillis

    The per-host read timeout in milliseconds.

    This defines how long the driver will wait for a given Cassandra node to answer a query.

    Please note that this is not the maximum time a call to Execute(String) may block; this is the maximum time that call will wait for one particular Cassandra host, but other hosts will be tried if one of them timeout. In other words, a Execute(String) call may theoretically wait up to ReadTimeoutMillis * {number_of_cassandra_hosts} (though the total number of hosts tried for a given query also depends on the LoadBalancingPolicy in use). Also note that for efficiency reasons, this read timeout is approximate, it may fire up to late. It is not meant to be used for precise timeout, but rather as a protection against misbehaving Cassandra nodes.
    Declaration
    public int ReadTimeoutMillis { get; }
    Property Value
    Type Description
    System.Int32

    ReceiveBufferSize

    Gets the size of the buffer used by the socket to receive

    Declaration
    public int? ReceiveBufferSize { get; }
    Property Value
    Type Description
    System.Nullable<System.Int32>

    ReuseAddress

    Declaration
    public bool? ReuseAddress { get; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>

    SendBufferSize

    Gets the size of the buffer used by the socket to send

    Declaration
    public int? SendBufferSize { get; }
    Property Value
    Type Description
    System.Nullable<System.Int32>

    SoLinger

    Gets the number of seconds to remain open after the Socket.Close() is called.

    Declaration
    public int? SoLinger { get; }
    Property Value
    Type Description
    System.Nullable<System.Int32>

    TcpNoDelay

    Gets a Boolean value that specifies whether the stream Socket is using the Nagle algorithm. When set to false, the Nagle algorithm is enabled; when set to true the Nagle algorithm is disabled (no delay). The default is true.

    Declaration
    public bool? TcpNoDelay { get; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>

    UseStreamMode

    Determines if the driver should use either .NET NetworkStream interface (true) or SocketEventArgs interface (false, default) to handle the reading and writing

    Declaration
    public bool UseStreamMode { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    SetConnectTimeoutMillis(Int32)

    Sets the number of milliseconds to wait for the socket to connect

    Declaration
    public SocketOptions SetConnectTimeoutMillis(int connectTimeoutMillis)
    Parameters
    Type Name Description
    System.Int32 connectTimeoutMillis
    Returns
    Type Description
    SocketOptions

    SetDefunctReadTimeoutThreshold(Int32)

    Determines the amount of requests that simultaneously have to timeout before closing the connection.

    Declaration
    public SocketOptions SetDefunctReadTimeoutThreshold(int amountOfTimeouts)
    Parameters
    Type Name Description
    System.Int32 amountOfTimeouts
    Returns
    Type Description
    SocketOptions

    SetKeepAlive(Boolean)

    Sets if TCP keep-alive must be used

    Declaration
    public SocketOptions SetKeepAlive(bool keepAlive)
    Parameters
    Type Name Description
    System.Boolean keepAlive
    Returns
    Type Description
    SocketOptions

    SetReadTimeoutMillis(Int32)

    Sets the per-host read timeout in milliseconds.

    When setting this value, keep in mind the following:

    - the timeout settings used on the Cassandra side (*_request_timeout_in_ms in cassandra.yaml) should be taken into account when picking a value for this read timeout. In particular, if this read timeout option is lower than Cassandra's timeout, the driver might assume that the host is not responsive and mark it down.

    - the read timeout is only approximate and only control the timeout to one Cassandra host, not the full query (see ReadTimeoutMillis for more details).

    Setting a value of 0 disables client read timeouts.
    Declaration
    public SocketOptions SetReadTimeoutMillis(int milliseconds)
    Parameters
    Type Name Description
    System.Int32 milliseconds
    Returns
    Type Description
    SocketOptions

    SetReceiveBufferSize(Int32)

    Sets the size of the buffer used by the socket to receive

    Declaration
    public SocketOptions SetReceiveBufferSize(int receiveBufferSize)
    Parameters
    Type Name Description
    System.Int32 receiveBufferSize
    Returns
    Type Description
    SocketOptions

    SetReuseAddress(Boolean)

    Declaration
    public SocketOptions SetReuseAddress(bool reuseAddress)
    Parameters
    Type Name Description
    System.Boolean reuseAddress
    Returns
    Type Description
    SocketOptions

    SetSendBufferSize(Int32)

    Sets the size of the buffer used by the socket to send

    Declaration
    public SocketOptions SetSendBufferSize(int sendBufferSize)
    Parameters
    Type Name Description
    System.Int32 sendBufferSize
    Returns
    Type Description
    SocketOptions

    SetSoLinger(Int32)

    Sets the number of seconds to remain open after the Socket.Close() is called.

    Declaration
    public SocketOptions SetSoLinger(int soLinger)
    Parameters
    Type Name Description
    System.Int32 soLinger
    Returns
    Type Description
    SocketOptions

    SetStreamMode(Boolean)

    Sets if the driver should use either .NET NetworkStream (true) interface or SocketEventArgs interface (false, default) to handle the reading and writing

    Declaration
    public SocketOptions SetStreamMode(bool useStreamMode)
    Parameters
    Type Name Description
    System.Boolean useStreamMode
    Returns
    Type Description
    SocketOptions

    SetTcpNoDelay(Boolean)

    Set a Boolean value that specifies whether the stream Socket is using the Nagle algorithm. Use false to enable Nagle algorithm; use true to disable Nagle algorithm (no delay). The default is true.

    Declaration
    public SocketOptions SetTcpNoDelay(bool tcpNoDelay)
    Parameters
    Type Name Description
    System.Boolean tcpNoDelay
    Returns
    Type Description
    SocketOptions
    Back to top © DataStax, All rights reserved.