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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
22 #if !defined(__ES_PANIC_H__)
23 #define __ES_PANIC_H__
25 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
26 #include <es_panic_internal.h>
27 #include <es_panic_partner.h>
30 /** The panic category for panics experienced by ESOCK clients (was "eSock panic" before Symbian OS version 9.1)
33 _LIT(KESockClientPanic, "ESock_client");
35 /** The panic numbers for panics panics experienced by ESOCK clients
36 @see KESockClientPanic
40 /** An invalid RSubSession handle was used. For example a RSocket call before the socket was Open()ed.
44 /** (No longer in use)
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.
51 EConnectingAlready = 2,
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.
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.
63 /** (No longer in use)
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.
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.
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.
83 /** RSocket::SendTo() used with a socket of a protocol that is connection-oriented (such as TCP/IP)
85 ECantSendToOnConnection = 9,
87 /** RSocket::Listen() used with a socket of a protocol that is not connection-oriented (such as UDP/IP)
89 EListenNeedsConnection = 10,
91 /** RSocket::Listen() used on a socket which is already Listen()ing.
93 EAlreadyListening = 11,
95 /** RSocket::Accept() used on a socket which has not had Listen() called.
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.
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:
109 void CMailTransferObject::SendText(HBufC8* aData)
111 iMailSocket.Write(aData->Des(), iStatus);
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.
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.
130 /** (No longer in use)
132 EBadQueyComplete = 16,
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
141 /** (No longer in use)
143 EMbufManagerNotLoaded = 18,
145 /** RHostResolver::Next() was called without a preceding resolution request such as RHostResolver::GetByName()
147 ENoResolveFirst = 19,
149 /** Attempted to Connect() on an RSocket in a programmatically invalid state, such as having been used for a
154 /** RHostResolver::QueryGetNext() was called without a preceding RHostResolver::Query().
158 /** (No longer in use)
160 EPermissionDenied = 22,
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().
165 EBadRConnection = 23,
167 /** RConnection::Open(RSocketServ&, TName&) used with an invalid TName (perhaps never initialised from
168 RConnection::Name() or that source connection was subsequently closed)
172 /** An extension interface has issued a bad request
176 /** The descriptor passed by the client could not be read from by the server.
179 EBadDescriptorRead = 26,
181 /** The descriptor passed by the client could not be written to by the server.
184 EBadDescriptorWrite = 27,
186 /** The descriptor passed by the client had an invalid length when read by the server.
189 EBadDescriptorLength = 28,
190 /** Open on an already opened socket
197 #endif // __ES_PANIC_H__