Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: es_sock.h

Sockets constants

Support

Supported from 5.0


Service information constants

Description

The following constants are defined for TServerProtocolDesc and TProtocolDesc in es_sock.h:


KSIConnectionLess

const TUint KSIConnectionLess

Description

The protocol is connectionless


KSIReliable

const TUint KSIReliable

Description

The protocol is reliable


KSIInOrder

const TUint KSIInOrder

Description

The protocol guarantees in-order delivery


KSIMessageBased

const TUint KSIMessageBased

Description

The protocol is message based


KSIDatagram

const TUint KSIDatagram

Description

The same as message based


KSIStreamBased

const TUint KSIStreamBased

Description

The protocol is stream based


KSIPseudoStream

const TUint KSIPseudoStream

Description

The protocol supports a stream like interface but maintains datagram boundaries


KSIUrgentData

const TUint KSIUrgentData

Description

The protocol offers an expedited data service


KSIConnectData

const TUint KSIConnectData

Description

The protocol can send user data on a connection request


KSIDisconnectData

const TUint KSIDisconnectData

Description

The protocol can send user data on a disconnect request


KSIBroadcast

const TUint KSIBroadcast

Description

The protocol supports broadcast addresses


KSIMultiPoint

const TUint KSIMultiPoint

Description

The protocol supports point to multi-point connections


KSIQOS

const TUint KSIQOS

Description

The protocol supports a quality of service metric


KSIWriteOnly

const TUint KSIWriteOnly

Description

The protocol is write only


KSIReadOnly

const TUint KSIReadOnly

Description

The protocol is read only


KSIGracefulClose

const TUint KSIGracefulClose

Description

The protocol supports graceful close


KSICanReconnect

const TUint KSICanReconnect

Description

The same socket can be reconnected if it disconnects (for whatever reason)


KSIPeekData

const TUint KSIPeekData

Description

Protocol supports peeking (looking at the data without removing it from the protocol).

[Top]


Naming service constants

Description

The following constants are defined for TServerProtocolDescand TProtocolDesc in es_sock.h:


KNSNameResolution

const TUint KNSNameResolution

Description

Protocol supports resolving human readable entity names into network addresses. (Like DNS)


KNSHeirarchicalNaming

const TUint KNSHeirarchicalNaming

Description

Network naming is hierarchical


KNSRemoteDiscovery

const TUint KNSRemoteDiscovery

Description

Addressing is dynamic and should be attempted every time before connecting. (Like IrDA).


KNSServiceResolution

const TUint KNSServiceResolution

Description

Protocol supports service name to port number resolution. (For example, you can look up ‘TCP’ to get port 48.)


KNSNameRegistration

const TUint KNSNameRegistration

Description

Protocol supports additions to the name database.


KNSServiceRegistration

const TUint KNSServiceRegistration

Description

Protocol supports additions to the service database.


KNSDynamicAddressing

const TUint KNSDynamicAddressing

Description

Addressing is dynamic - i.e. name to address mapping may change. (Like IrDA which randomly chooses machine addresses.)


KNSInfoDatabase

const TUint KNSInfoDatabase

Description

Protocol has another database which is defined by the protocol.

[Top]


Security scheme constants

Description

The following constants are defined for TServerProtocolDescand TProtocolDesc in es_sock.h:


KSocketNoSecurity

const TUint KSocketNoSecurity

Description

No security


KSecureSockets

const TUint KSecureSockets

Description

Secure Sockets Layer

[Top]


Special message size constants

Description

The following constants are defined for TServerProtocolDescand TProtocolDesc in es_sock.h:


KSocketMessageSizeIsStream

const TInt KSocketMessageSizeIsStream

Description

Reads and Writes can be of any size - the data is treated as a stream.


KSocketMessageSizeUndefined

const TInt KSocketMessageSizeUndefined

Description

Depends on lower layer or is dynamic


KSocketMessageSizeNoLimit

const TInt KSocketMessageSizeNoLimit

Description

Data is packet-oriented but packets can be of any size. (i.e. the remote end must specify a Read of the same size as your Write, but there is no limit on this size.

[Top]


Socket type constants

Description

The following constants for socket types are defined in es_sock.h:


KSockStream

const TUint KSockStream

Description

Stream socket


KSockDatagram

const TUint KSockDatagram

Description

Datagram socket


KSockSeqPacket

const TUint KSockSeqPacket

Description

Currently unused


KSockRaw

const TUint KSockRaw

Description

Raw socket

[Top]


Error code

Description

The following error code is defined in es_sock.h:


KErrWouldBlock

const TInt KErrWouldBlock

Description

This error is returned from operations on non-blocking sockets that cannot be completed immediately, for example receive when no data is queued for reading. It is a non-fatal error, and the operation should be retried later.

[Top]


Generic socket options

Description

The following constants for generic socket options are defined in es_sock.h. They are used through RSocket::SetOpt(), andRSocket::GetOpt() with anOptionLevel set toKSOLSocket. Options can be both get and set unless otherwise stated.

Notes:

Setting the send and receive buffer sizes explicitly can help to reduce the memory requirements if many data sockets are used in an application. If a socket is datagram-oriented and its receive/send buffer size is set toKSocketBufSizeUndefined, then the initial buffer size will beKSocketDefaultBufferSize and buffers will grow to accommodate larger sends/receives. If the buffer size is set explicitly for datagram-oriented sockets, sends which exceed the set size will fail withKErrTooBig and receives will be truncated. For stream based sockets there should be no noticeable effect on client reads, unless the buffer size is set to a prohibitively low value.


Option

Option

Description

Description


KSODebug

const TUint KSODebug

Description

Debugging enabled or disabled . Values are:


KSORecvBuf

const TUint KSORecvBuf

Description

Socket receive buffer size. Values are:


KSOSendBuf

const TUint KSOSendBuf

Description

Socket send buffer size. Values are:


KSONonBlockingIO

const TUint KSONonBlockingIO

Description

Socket nonblocking mode. To set, no option values are required. For getting, values are:


KSOBlockingIO

const TUint KSOBlockingIO

Description

Socket blocking mode. To set, no values are required. For getting, values are:


KSOSelectLastError

const TUint KSOSelectLastError

Description

Getting only: retrieves the last error. Value is aTInt.


KSOSelectPoll

const TUint KSOSelectPoll

Description

Getting only: gets a bitmask of flags describing the read/write/exception status of the socket. Value is a TInt containing a bitmask of socket status (KSockSelectExcept etc.) constants.


KSOUrgentDataOffset

const TUint KSOUrgentDataOffset

Description

Getting only: retrieve the urgent data offset (only for stream protocols that support urgent data). Value is a TInt.

[Top]


Buffer size

Description

The following constants relating to buffer sizes are defined in es_sock.h. For details on their use, see Sockets.const-setoptions.


KSocketBufSizeUndefined

const TInt KSocketBufSizeUndefined

Description

Use default buffer size.


KSocketDefaultBufferSize

const TInt KSocketDefaultBufferSize

Description

Default buffer size

[Top]


Socket status

Description

The following constants relating to socket status are defined in es_sock.h. See also KSOSelectLastError and KSOSelectPoll in Sockets.const-setoptions, and Sockets.const-ioctl.


KSockSelectExcept

const TUint KSockSelectExcept

Description

An error has occurred


KSockSelectRead

const TUint KSockSelectRead

Description

Data is available to be read; for listening sockets, a connect is pending


KSockSelectWrite

const TUint KSockSelectWrite

Description

Writing to the socket is not currently blocked by flow-control

[Top]


Ioctl commands

Description

The following ioctl command constant is defined in es_sock.h. It is used through RSocket::Ioctl(), with aLevel set to KSOLSocket.


KIOctlSelect

const TUint KIOctlSelect

Description

The aDesc parameter of RSocket::Ioctl()specifies a TUint containing a bitmask of Sockets.const-sockstatus constants. The completion status will be the subset of those conditions which is now true for the socket.

See also the KSOSelectPoll parameter toRSocket::GetOpt(), which allows the current select state of the socket to be read synchronously, and KSOSelectLastError, which returns the error code.

[Top]


Option and command levels

Description

The following constants are used to define level parameters forRSocket::Ioctl(), RSocket::GetOpt() andRSocket::SetOpt(). They are defined in es_sock.h.


KLevelUnspecified

const TInt KLevelUnspecified

Description

Unspecified level


KSOLSocket

const TInt KSOLSocket

Description

Generic socket options/commands