epoc32/include/es_panic.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/es_panic.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,199 @@
     1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @publishedAll
    1.22 + @released
    1.23 +*/
    1.24 +
    1.25 +#if !defined(__ES_PANIC_H__)
    1.26 +#define __ES_PANIC_H__
    1.27 +
    1.28 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.29 +#include <es_panic_internal.h>
    1.30 +#include <es_panic_partner.h>
    1.31 +#endif
    1.32 +
    1.33 +/** The panic category for panics experienced by ESOCK clients (was "eSock panic" before Symbian OS version 9.1)
    1.34 +@see TESockPanic
    1.35 +*/
    1.36 +_LIT(KESockClientPanic, "ESock_client");
    1.37 +
    1.38 +/**	The panic numbers for panics panics experienced by ESOCK clients
    1.39 +@see KESockClientPanic
    1.40 +*/
    1.41 +enum TESockPanic
    1.42 +	{
    1.43 +	/** An invalid RSubSession handle was used. For example a RSocket call before the socket was Open()ed.
    1.44 +	*/
    1.45 +	ESockBadHandle = 0,
    1.46 +
    1.47 +	/** (No longer in use)
    1.48 +	*/
    1.49 +	EBadCancel = 1,
    1.50 +
    1.51 +	/** RSocket::Connect() used before a previous connect request on the same socket has completed.
    1.52 +	Wait for the first to complete or CancelConnect() it.
    1.53 +	*/
    1.54 +	EConnectingAlready = 2,
    1.55 +
    1.56 +	/** RSocket::Read(), Recv(), RecvFrom(), or RecvOneOrMore() used before a previous read request
    1.57 +	on the same socket has completed. Wait for the first to complete or CancelRead()/CancelRecv() it.
    1.58 +	*/
    1.59 +	EReadingAlready = 3,
    1.60 +
    1.61 +	/** RSocket::Send(), SendTo(), or Write() used before a previous write request on the same socket
    1.62 +	has completed. Wait for the first to complete or CancelWrite()/CancelSend() it.
    1.63 +	*/
    1.64 +	EWritingAlready = 4,
    1.65 +
    1.66 +	/** (No longer in use)
    1.67 +	*/
    1.68 +	ECloseTwice = 5,
    1.69 +
    1.70 +	/** RSocket::Shutdown() used before a previous shutdown request on the same socket has completed.
    1.71 +	Wait for the first to complete. This applies also when the shutdown type differs, eg
    1.72 +	Shutdown(EStopInput) must complete before Shutdown(EStopOutput) can be issued.
    1.73 +	*/
    1.74 +	EShutDownTwice = 6,
    1.75 +
    1.76 +	/** The socket passed to RSocket::Accept() must be a blank socket opened by the argumentless
    1.77 +	RSocket::Open() overload; a socket opened with a protocol or already Accept()ed is not blank.
    1.78 +	*/
    1.79 +	EAcceptTwice = 7,
    1.80 +
    1.81 +	/** RSocket::Ioctl() used before a previous IOCtl request on the same socket has completed. Wait
    1.82 +	for the first to complete or CancelIoctl() it.
    1.83 +	*/
    1.84 +	ETwoIoctls = 8,
    1.85 +
    1.86 +	/** RSocket::SendTo() used with a socket of a protocol that is connection-oriented (such as TCP/IP)
    1.87 +	*/
    1.88 +	ECantSendToOnConnection = 9,
    1.89 +
    1.90 +	/** RSocket::Listen() used with a socket of a protocol that is not connection-oriented (such as UDP/IP)
    1.91 +	*/
    1.92 +	EListenNeedsConnection = 10,
    1.93 +
    1.94 +	/** RSocket::Listen() used on a socket which is already Listen()ing.
    1.95 +	*/
    1.96 +	EAlreadyListening = 11,
    1.97 +
    1.98 +	/** RSocket::Accept() used on a socket which has not had Listen() called.
    1.99 +	*/
   1.100 +	ENotListening = 12,
   1.101 +
   1.102 +	/** RSocket::Accept() used with a socket which proves invalid when the passive-open completes. For example
   1.103 +	the blank socket passed to Accept() was closed before a connection to the listening server socket was made.
   1.104 +	CancelAccept() must be used before closing the blank socket.
   1.105 +	*/
   1.106 +	EBadAccept = 13,
   1.107 +
   1.108 +	/** A descriptor argument was corrupt when used by the socket server, which for asynchronous requests may
   1.109 +	only be when they complete. A common cause of this is allowing a buffer to go out of scope when using data
   1.110 +	transfer functions. For example:
   1.111 +	@code
   1.112 +		void CMailTransferObject::SendText(HBufC8* aData)
   1.113 +			{
   1.114 +			iMailSocket.Write(aData->Des(), iStatus);
   1.115 +			}
   1.116 +	@endcode
   1.117 +	Here the coder has overlooked the fact that HBufC8::Des() returns a TPtr8 object, which being a temporary
   1.118 +	will go out of scope when Write() returns. However because ESOCK runs at high scheduler priority and protocols
   1.119 +	are commonly able to accept data immediately the request will usually have been completed before Write()
   1.120 +	returns. The panic might only occur for this mail application when it sends a large amount of data or the
   1.121 +	network is unusually slow. In this example the code should simply have dereferenced the HBufC8* as all that
   1.122 +	Write() requires is a const TDesC8.
   1.123 +	*/
   1.124 +	EBadDescriptor = 14,
   1.125 +
   1.126 +	/** A request was made of a RHostResolver, RServiceResolver, or RNetDatabase when it was still processing a previous
   1.127 +	request. Usually this would be with an explicitly asynchronous request and you must either cancel it or wait for it
   1.128 +	to complete. If occurs with multiple threads issuing synchronous requests then you must implement appropriate
   1.129 +	synchronisation between the threads to avoid this simultaneous use.
   1.130 +	*/
   1.131 +	ETwice = 15,
   1.132 +
   1.133 +	/** (No longer in use)
   1.134 +	*/
   1.135 +	EBadQueyComplete = 16,
   1.136 +
   1.137 +	/** An improper request was made of a blank socket, ie one created through the argumentless Open() method and not
   1.138 +	yet opened as a passive connection through Accept() on a Listen()ing socket. Improper requests include any which
   1.139 +	require a specific underlying technology, such as Shutdown() - all that need be done to clean-up a blank socket
   1.140 +	is Close()ing it.
   1.141 +	*/
   1.142 +	ENullSocket = 17,
   1.143 +
   1.144 +	/** (No longer in use)
   1.145 +	*/
   1.146 +	EMbufManagerNotLoaded = 18,
   1.147 +
   1.148 +	/** RHostResolver::Next() was called without a preceding resolution request such as RHostResolver::GetByName()
   1.149 +	*/
   1.150 +	ENoResolveFirst = 19,
   1.151 +
   1.152 +	/** Attempted to Connect() on an RSocket in a programmatically invalid state, such as having been used for a
   1.153 +	pending Accept().
   1.154 +	*/
   1.155 +	ECannotConnect = 20,
   1.156 +
   1.157 +	/** RHostResolver::QueryGetNext() was called without a preceding RHostResolver::Query().
   1.158 +	*/
   1.159 +	ENoQueryFirst = 21,
   1.160 +
   1.161 +	/** (No longer in use)
   1.162 +	*/
   1.163 +	EPermissionDenied = 22,
   1.164 +
   1.165 +	/** RSocket::Open() or RHostResolver::Open() used with a RConnection or RSubConnection opened upon a
   1.166 +	different RSocketServ to that supplied to the current Open().
   1.167 +	*/
   1.168 +	EBadRConnection = 23,
   1.169 +
   1.170 +	/** RConnection::Open(RSocketServ&, TName&) used with an invalid TName (perhaps never initialised from
   1.171 +	RConnection::Name() or that source connection was subsequently closed)
   1.172 +	*/
   1.173 +	EInvalidName = 24,
   1.174 +
   1.175 +    /**  An extension interface has issued a bad request
   1.176 +    */
   1.177 +	EBadRequest = 25,
   1.178 +
   1.179 +	/**	The descriptor passed by the client could not be read from by the server.
   1.180 +	@see EBadDescriptor
   1.181 +	*/
   1.182 +	EBadDescriptorRead = 26,
   1.183 +
   1.184 +	/**	The descriptor passed by the client could not be written to by the server.
   1.185 +	@see EBadDescriptor
   1.186 +	*/
   1.187 +	EBadDescriptorWrite = 27,
   1.188 +
   1.189 +	/**	The descriptor passed by the client had an invalid length when read by the server.
   1.190 +	@see EBadDescriptor
   1.191 +	*/
   1.192 +	EBadDescriptorLength = 28,
   1.193 +	/** Open on an already opened socket
   1.194 +	*/
   1.195 +	ENotNullSocket	= 29
   1.196 +
   1.197 +    };
   1.198 +
   1.199 +
   1.200 +#endif   // __ES_PANIC_H__
   1.201 +
   1.202 +