epoc32/include/es_panic.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100 (2010-03-31)
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @publishedAll
    19  @released
    20 */
    21 
    22 #if !defined(__ES_PANIC_H__)
    23 #define __ES_PANIC_H__
    24 
    25 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    26 #include <es_panic_internal.h>
    27 #include <es_panic_partner.h>
    28 #endif
    29 
    30 /** The panic category for panics experienced by ESOCK clients (was "eSock panic" before Symbian OS version 9.1)
    31 @see TESockPanic
    32 */
    33 _LIT(KESockClientPanic, "ESock_client");
    34 
    35 /**	The panic numbers for panics panics experienced by ESOCK clients
    36 @see KESockClientPanic
    37 */
    38 enum TESockPanic
    39 	{
    40 	/** An invalid RSubSession handle was used. For example a RSocket call before the socket was Open()ed.
    41 	*/
    42 	ESockBadHandle = 0,
    43 
    44 	/** (No longer in use)
    45 	*/
    46 	EBadCancel = 1,
    47 
    48 	/** RSocket::Connect() used before a previous connect request on the same socket has completed.
    49 	Wait for the first to complete or CancelConnect() it.
    50 	*/
    51 	EConnectingAlready = 2,
    52 
    53 	/** RSocket::Read(), Recv(), RecvFrom(), or RecvOneOrMore() used before a previous read request
    54 	on the same socket has completed. Wait for the first to complete or CancelRead()/CancelRecv() it.
    55 	*/
    56 	EReadingAlready = 3,
    57 
    58 	/** RSocket::Send(), SendTo(), or Write() used before a previous write request on the same socket
    59 	has completed. Wait for the first to complete or CancelWrite()/CancelSend() it.
    60 	*/
    61 	EWritingAlready = 4,
    62 
    63 	/** (No longer in use)
    64 	*/
    65 	ECloseTwice = 5,
    66 
    67 	/** RSocket::Shutdown() used before a previous shutdown request on the same socket has completed.
    68 	Wait for the first to complete. This applies also when the shutdown type differs, eg
    69 	Shutdown(EStopInput) must complete before Shutdown(EStopOutput) can be issued.
    70 	*/
    71 	EShutDownTwice = 6,
    72 
    73 	/** The socket passed to RSocket::Accept() must be a blank socket opened by the argumentless
    74 	RSocket::Open() overload; a socket opened with a protocol or already Accept()ed is not blank.
    75 	*/
    76 	EAcceptTwice = 7,
    77 
    78 	/** RSocket::Ioctl() used before a previous IOCtl request on the same socket has completed. Wait
    79 	for the first to complete or CancelIoctl() it.
    80 	*/
    81 	ETwoIoctls = 8,
    82 
    83 	/** RSocket::SendTo() used with a socket of a protocol that is connection-oriented (such as TCP/IP)
    84 	*/
    85 	ECantSendToOnConnection = 9,
    86 
    87 	/** RSocket::Listen() used with a socket of a protocol that is not connection-oriented (such as UDP/IP)
    88 	*/
    89 	EListenNeedsConnection = 10,
    90 
    91 	/** RSocket::Listen() used on a socket which is already Listen()ing.
    92 	*/
    93 	EAlreadyListening = 11,
    94 
    95 	/** RSocket::Accept() used on a socket which has not had Listen() called.
    96 	*/
    97 	ENotListening = 12,
    98 
    99 	/** RSocket::Accept() used with a socket which proves invalid when the passive-open completes. For example
   100 	the blank socket passed to Accept() was closed before a connection to the listening server socket was made.
   101 	CancelAccept() must be used before closing the blank socket.
   102 	*/
   103 	EBadAccept = 13,
   104 
   105 	/** A descriptor argument was corrupt when used by the socket server, which for asynchronous requests may
   106 	only be when they complete. A common cause of this is allowing a buffer to go out of scope when using data
   107 	transfer functions. For example:
   108 	@code
   109 		void CMailTransferObject::SendText(HBufC8* aData)
   110 			{
   111 			iMailSocket.Write(aData->Des(), iStatus);
   112 			}
   113 	@endcode
   114 	Here the coder has overlooked the fact that HBufC8::Des() returns a TPtr8 object, which being a temporary
   115 	will go out of scope when Write() returns. However because ESOCK runs at high scheduler priority and protocols
   116 	are commonly able to accept data immediately the request will usually have been completed before Write()
   117 	returns. The panic might only occur for this mail application when it sends a large amount of data or the
   118 	network is unusually slow. In this example the code should simply have dereferenced the HBufC8* as all that
   119 	Write() requires is a const TDesC8.
   120 	*/
   121 	EBadDescriptor = 14,
   122 
   123 	/** A request was made of a RHostResolver, RServiceResolver, or RNetDatabase when it was still processing a previous
   124 	request. Usually this would be with an explicitly asynchronous request and you must either cancel it or wait for it
   125 	to complete. If occurs with multiple threads issuing synchronous requests then you must implement appropriate
   126 	synchronisation between the threads to avoid this simultaneous use.
   127 	*/
   128 	ETwice = 15,
   129 
   130 	/** (No longer in use)
   131 	*/
   132 	EBadQueyComplete = 16,
   133 
   134 	/** An improper request was made of a blank socket, ie one created through the argumentless Open() method and not
   135 	yet opened as a passive connection through Accept() on a Listen()ing socket. Improper requests include any which
   136 	require a specific underlying technology, such as Shutdown() - all that need be done to clean-up a blank socket
   137 	is Close()ing it.
   138 	*/
   139 	ENullSocket = 17,
   140 
   141 	/** (No longer in use)
   142 	*/
   143 	EMbufManagerNotLoaded = 18,
   144 
   145 	/** RHostResolver::Next() was called without a preceding resolution request such as RHostResolver::GetByName()
   146 	*/
   147 	ENoResolveFirst = 19,
   148 
   149 	/** Attempted to Connect() on an RSocket in a programmatically invalid state, such as having been used for a
   150 	pending Accept().
   151 	*/
   152 	ECannotConnect = 20,
   153 
   154 	/** RHostResolver::QueryGetNext() was called without a preceding RHostResolver::Query().
   155 	*/
   156 	ENoQueryFirst = 21,
   157 
   158 	/** (No longer in use)
   159 	*/
   160 	EPermissionDenied = 22,
   161 
   162 	/** RSocket::Open() or RHostResolver::Open() used with a RConnection or RSubConnection opened upon a
   163 	different RSocketServ to that supplied to the current Open().
   164 	*/
   165 	EBadRConnection = 23,
   166 
   167 	/** RConnection::Open(RSocketServ&, TName&) used with an invalid TName (perhaps never initialised from
   168 	RConnection::Name() or that source connection was subsequently closed)
   169 	*/
   170 	EInvalidName = 24,
   171 
   172     /**  An extension interface has issued a bad request
   173     */
   174 	EBadRequest = 25,
   175 
   176 	/**	The descriptor passed by the client could not be read from by the server.
   177 	@see EBadDescriptor
   178 	*/
   179 	EBadDescriptorRead = 26,
   180 
   181 	/**	The descriptor passed by the client could not be written to by the server.
   182 	@see EBadDescriptor
   183 	*/
   184 	EBadDescriptorWrite = 27,
   185 
   186 	/**	The descriptor passed by the client had an invalid length when read by the server.
   187 	@see EBadDescriptor
   188 	*/
   189 	EBadDescriptorLength = 28,
   190 	/** Open on an already opened socket
   191 	*/
   192 	ENotNullSocket	= 29
   193 
   194     };
   195 
   196 
   197 #endif   // __ES_PANIC_H__
   198 
   199