Symbian
 Developer Library

DEVELOPER LIBRARY

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



Location: es_sock.h

Sockets constants

Support

Supported from 5.0


KAFUnspec

const TUint KAFUnspec

Description

Default (unspecified) protocol module.

[Top]


KMaxSockAddrSize

const TUint KMaxSockAddrSize=0x20;

Description

Maximum sockets address size.

[Top]


KESockDefaultMessageSlots

const TUint KESockDefaultMessageSlots=8;

Description

Default number of message slots.

[Top]


Service information constants

Description

The following constants are defined for TServerProtocolDesc and TProtocolDesc:


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 TServerProtocolDesc and 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 TServerProtocolDesc and TProtocolDesc:


KSocketNoSecurity

const TUint KSocketNoSecurity

Description

No security


KSecureSockets

const TUint KSecureSockets

Description

Secure Sockets Layer.

See also:

[Top]


Special message size constants

Description

The following constants are defined for TServerProtocolDesc and TProtocolDesc:


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:


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.


KUndefinedSockType

const TUint KUndefinedSockType;

Description

Undefined socket type.

[Top]


Error code

Description

The following error code is defined:


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(), and RSocket::GetOpt() with anOptionLevel set to KSOLSocket. 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 to KSocketBufSizeUndefined, then the initial buffer size will be KSocketDefaultBufferSize 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 with KErrTooBig 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.


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:


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.


KSOReadBytesPending

const TUint KSOReadBytesPending

Description

Getting only: retrieve the number of bytes currently available for reading.

Value is a TInt.


KSOUrgentDataOffset

const TUint KSOUrgentDataOffset

Description

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


KSOSelectLastError

const TUint KSOSelectLastError

Description

Getting only: retrieves the last error. Value is a TInt.

[Top]


Buffer size

Description

The following constants relating to buffer sizes are defined:


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. See also KSOSelectLastError and KSOSelectPoll.


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 Socket status constants. The completion status will be the subset of those conditions which is now true for the socket.

See also the KSOSelectPoll parameter to RSocket::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 for RSocket::Ioctl(), RSocket::GetOpt() and RSocket::SetOpt().


KLevelUnspecified

const TInt KLevelUnspecified

Description

Unspecified level.


KSOLSocket

const TInt KSOLSocket

Description

Generic socket options/commands.

[Top]


Socket Write Flags

[Top]


Class KSockWriteUrgent

const TUint KSockWriteUrgent=0x00000001;

Description

Urgent write

[Top]


Socket Read Flags

[Top]


Class KSockReadPeek

const TUint KSockReadPeek=0x00000001;

Description

Read copy of data - reading again will retrieve same data

[Top]


Internal members

[Top]


KSocketInternalOptionBit

const TUint KSocketInternalOptionBit=0x80000000;

Description

This member is internal and not intended for use.

[Top]


KInternalIoctlBit

const TUint KInternalIoctlBit=0x80000000

Description

This member is internal and not intended for use.

[Top]


KSocketInternalWriteBit

const TUint KSocketInternalWriteBit=0x80000000;

Description

This member is internal and not intended for use.

[Top]


KSocketInternalReadBit

const TUint KSocketInternalReadBit=0x80000000;

Description

This member is internal and not intended for use.