Location:
es_sock.h
The following constants are defined for
TServerProtocolDesc
and TProtocolDesc
in es_sock.h:
const TUint KSIPseudoStream
The protocol supports a stream like interface but maintains datagram boundaries
const TUint KSICanReconnect
The same socket can be reconnected if it disconnects (for whatever reason)
const TUint KSIPeekData
Protocol supports peeking (looking at the data without removing it from the protocol).
The following constants are defined for
TServerProtocolDesc
and TProtocolDesc
in es_sock.h:
const TUint KNSNameResolution
Protocol supports resolving human readable entity names into network addresses. (Like DNS)
const TUint KNSRemoteDiscovery
Addressing is dynamic and should be attempted every time before connecting. (Like IrDA).
const TUint KNSServiceResolution
Protocol supports service name to port number resolution. (For example, you can look up ‘TCP’ to get port 48.)
const TUint KNSDynamicAddressing
Addressing is dynamic - i.e. name to address mapping may change. (Like IrDA which randomly chooses machine addresses.)
const TUint KNSInfoDatabase
Protocol has another database which is defined by the protocol.
The following constants are defined for
TServerProtocolDesc
and TProtocolDesc
in es_sock.h:
The following constants are defined for
TServerProtocolDesc
and TProtocolDesc
in es_sock.h:
const TInt KSocketMessageSizeIsStream
Reads and Writes can be of any size - the data is treated as a stream.
const TInt KSocketMessageSizeNoLimit
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.
const TInt KErrWouldBlock
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.
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.
const TUint KSODebug
Debugging enabled or disabled . Values are:
(TInt)0
. Disabled
(TInt)1
. Enabled
const TUint KSORecvBuf
Socket receive buffer size. Values are:
KSocketBufSizeUndefined
: see notes below.
1
to KMaxTUint
: explicit buffer size, supplied
as a TPckgBuf<TUint>
const TUint KSOSendBuf
Socket send buffer size. Values are:
KSocketBufSizeUndefined
: see notes below.
1
to KMaxTUint
: explicit buffer size, supplied
as a TPckgBuf<TUint>
const TUint KSONonBlockingIO
Socket nonblocking mode. To set, no option values are required. For getting, values are:
(TInt)0
. Disabled
(TInt)1
. Enabled
const TUint KSOBlockingIO
Socket blocking mode. To set, no values are required. For getting, values are:
(TInt)0
. Disabled
(TInt)1
. Enabled
const TUint KSOSelectPoll
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.
const TUint KSOUrgentDataOffset
Getting only: retrieve the urgent data offset (only for stream protocols
that support urgent data). Value is a TInt
.
The following constants relating to buffer sizes are defined in es_sock.h. For details on their use, see Sockets.const-setoptions.
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.
const TUint KSockSelectRead
Data is available to be read; for listening sockets, a connect is pending
const TUint KSockSelectWrite
Writing to the socket is not currently blocked by flow-control
The following ioctl command constant is defined in es_sock.h.
It is used through RSocket::Ioctl()
, with aLevel
set
to KSOLSocket
.
const TUint KIOctlSelect
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.
The following constants are used to define level parameters
forRSocket::Ioctl()
, RSocket::GetOpt()
andRSocket::SetOpt()
. They are defined in es_sock.h.
const TInt KSOLSocket
Generic socket options/commands