1 // Copyright (c) 1997-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_SOCK_H__)
29 #undef _DEBUG_SOCKET_FUNCTIONS
31 #define _DEBUG_SOCKET_FUNCTIONS
34 #include <comms-infras/metacontainer.h>
35 #include <elements/sd_errors.h>
36 #include <comms-infras/es_parameterset.h>
38 #include <comms-infras/es_event.h>
41 using Meta::SMetaDataECom;
42 using Meta::RMetaDataEComContainer;
45 // Forward declaration of CCommsDataObjectBase
48 class CCommsDataObjectBase;
52 Canonical names for the core ESOCKSVR modules
54 _LIT8(SOCKET_SERVER_MAIN_MODULE_NAME, "ESock_Main"); // Worker 0
55 _LIT8(SOCKET_SERVER_IP_MODULE_NAME, "ESock_IP"); // Worker 1
56 _LIT8(SOCKET_SERVER_BT_MODULE_NAME, "ESock_Bt"); // Worker 2
57 _LIT8(SOCKET_SERVER_IR_MODULE_NAME, "ESock_Ir"); // Worker 3
58 _LIT8(SOCKET_SERVER_SMSWAP_MODULE_NAME, "ESock_SmsWap"); // Worker 4
62 Progress Notification to inform clients Connection is up
63 This event has the same numerical values as
64 KLinkLayerOpen which is deprecated
69 const TUint KConnectionUp = 7000;
71 Progress Notification to inform clients Connection is up
72 This event has the same numerical values as
73 KLinkLayerClosed which is deprecated
79 const TUint KConnectionDown = 8000;
84 Default number of message slots.
88 const TUint KESockDefaultMessageSlots=8;
92 Size of Maximum SubConnection event
96 @note If you allocate this on the heap, remember to delete through the pointer to the buffer and not any pointers to the events held inside it
97 if you change this value, you will alter the function signature and break the .def file
99 const TUint KMaxSubConnectionEventSize = 512;
102 SubConnection Unique Id
104 THIS API IS TO BE DEPRECATED
109 typedef TUint TSubConnectionUniqueId;
112 Buffer for notification of any change in the state of SubConnection.
114 THIS API IS TO BE DEPRECATED
119 typedef TBuf8<KMaxSubConnectionEventSize> TSubConnectionNotificationBuf;
121 const TUint KUseEmbeddedUniqueId = 0; //< Used by RConnection to identify cases where the subconnection id is embedded in the data structure
123 const TUint KConnProgressDefault = 0; //< Default Connection Progress
127 Hint to the Socket Server on what will be the principal usage of the connection.
128 It is by no means a restriction but may result in better performance for the session.
135 IMPORT_C TSessionPref();
137 /** The protocol's address family. For example, for TCP/IP protocols, KAfInet. */
139 /** The protocol type. */
155 Contains progress information on a dial-up connection
162 inline TNifProgress();
163 inline TNifProgress(TInt aStage, TInt aError);
164 inline TBool operator==(const TNifProgress& aRHS) const;
171 Contains information describing an agent
178 /** This class Contains version information */
181 /** This class Defines a modifiable buffer descriptor that can contain the name of a reference counting object */
186 Buffer for Network Interface Progress
191 typedef TPckgBuf<TNifProgress> TNifProgressBuf;
194 Socket address offsets.
200 /** Socket address offsets.
202 This class defines the internal offsets of data members for the TSockAddr
205 /** Address family of socket address */
207 /** Port (or equivilent) number */
212 Maximum sockets address size.
216 const TUint KMaxSockAddrSize=0x20;
218 class TSockAddr : public TBuf8<KMaxSockAddrSize>
219 /** Represents an end point address.
221 Protocols interpret the class within the socket server to route packets and
222 form connections. It can be used on its own or as derived by protocols. The
223 SSockAddr class acts as an offset map for the TSockAddr class which has a
224 family field and a port field. The family field may be used by protocols to
225 "up-cast" the base-class to the correct derived class. The port field is provided
226 because it is a common practice for protocols to use port equivalents in addressing.
228 Writing derived classes:
230 The two protected member functions allow further data members to be defined
231 past the area of the base SSockAddr. In any derived constructor the length
232 of the descriptor should be set to the length of the valid data contained
233 in the address. Subsequent member function calls should also adjust the length
234 if it affects valid data.
239 IMPORT_C TSockAddr();
240 IMPORT_C TSockAddr(TUint aFamily);
241 IMPORT_C TUint Family() const;
242 IMPORT_C void SetFamily(TUint aFamily);
243 IMPORT_C TUint Port() const;
244 IMPORT_C void SetPort(TUint aPort);
245 IMPORT_C TBool CmpPort(const TSockAddr& anAddr) const;
246 IMPORT_C TInt GetUserLen();
248 IMPORT_C void SetUserLen(TInt aLen);
249 inline TUint8* UserPtr() const;
251 inline SSockAddr* BasePtr() const;
254 // Address families (based upon protocol IDs used by ARP/REVARP)
255 /** Default (unspecified) protocol module.
258 const TUint KAFUnspec=0;
264 const TUint KSockStream=1;
265 /** Datagram socket. */
266 const TUint KSockDatagram=2;
267 /** Datagrams with sequence numbers. */
268 const TUint KSockSeqPacket=3;
270 const TUint KSockRaw=4;
272 // constants for various socket calls - can't be enums cos they're largely defined by protocols
273 // The following constants are used to define level parameters for RSocket::Ioctl(), RSocket::GetOpt()
274 // and RSocket::SetOpt().
275 /** Generic socket options/commands.
278 const TInt KSOLSocket=1;
279 /** Unspecified level. */
280 const TInt KLevelUnspecified=0;
282 // Socket options defined by the server.
283 // Used through RSocket::SetOpt(), and RSocket::GetOpt() with anOptionLevel set
284 // to KSOLSocket. Options can be both get and set unless otherwise.
287 // Setting the send and receive buffer sizes explicitly can help to reduce
288 // the memory requirements if many data sockets are used in an application. If a
289 // socket is datagram-oriented and its receive/send buffer size is set
290 // to KSocketBufSizeUndefined, then the initial buffer size will
291 // be KSocketDefaultBufferSize and buffers will grow to accommodate
292 // larger sends/receives. If the buffer size is set explicitly for
293 // datagram-oriented sockets, sends which exceed the set size will fail
294 // with KErrTooBig and receives will be truncated. For stream based
295 // sockets there should be no noticeable effect on client reads, unless the buffer
296 // size is set to a prohibitively low value.
297 /** Debugging enabled or disabled . Values are:
304 const TUint KSODebug=1;
305 /** Socket receive buffer size. Values are:
307 KSocketBufSizeUndefined
309 1 to KMaxTUint: explicit buffer size, supplied as a TPckgBuf<TUint> */
310 const TUint KSORecvBuf=2;
311 /** Socket send buffer size. Values are:
313 KSocketBufSizeUndefined
315 1 to KMaxTUint: explicit buffer size, supplied as a TPckgBuf<TUint> */
316 const TUint KSOSendBuf=3;
317 /** Socket nonblocking mode. To set, no option values are required. For getting,
323 const TUint KSONonBlockingIO=4;
324 /** Socket blocking mode. To set, no values are required. For getting, values are:
329 const TUint KSOBlockingIO=5;
330 /** Getting only: gets a bitmask of flags describing the read/write/exception status
331 of the socket. Value is a TInt containing a bitmask of socket status (KSockSelectExcept
333 const TUint KSOSelectPoll=6;
334 /** Getting only: retrieve the number of bytes currently available for reading.
336 const TUint KSOReadBytesPending=7;
337 /** Getting only: retrieve the urgent data offset (only for stream protocols that
338 support urgent data).
340 const TUint KSOUrgentDataOffset=8;
342 Getting only: retrieves the last error.
343 Errors are normally reported by the called method and behaviour is protocol dependent.
344 KSOSelectLastError does not return such errors.
346 const TUint KSOSelectLastError=9;
350 Setting only. Enables socket to be transferred to the process with given capabilities.
351 The capabilities set should be supplied as TPckgBuf<TSecurityPolicy>.
352 Each RSocket::Transfer() call must be enabled by setting this option.
355 const TUint KSOEnableTransfer = 10;
357 /** Setting only. Disables a socket's possibility to be transferred. No option required.
361 const TUint KSODisableTransfer = 11;
363 // The following constants relating to buffer sizes are defined
365 /** Use default buffer size. */
366 const TInt KSocketBufSizeUndefined=0;
367 /** Default buffer size. */
368 const TInt KSocketDefaultBufferSize=4096;
371 const TUint KSocketInternalOptionBit=0x80000000; //< Must not be set for client requests
374 /** The aDesc parameter of RSocket::Ioctl() specifies a TUint containing a bitmask
375 of Socket status constants. The completion status will be the subset of those
376 conditions which is now true for the socket.
378 Used through RSocket::Ioctl(), with aLevel set to KSOLSocket.
380 @see KSOSelectPoll parameter to RSocket::GetOpt(), which allows the
381 current select state of the socket to be read synchronously, and KSOSelectLastError,
382 which returns the error code. */
383 const TUint KIOctlSelect=1;
385 // Select ioctl states
386 // Socket status. See also KSOSelectLastError and KSOSelectPoll.
387 /** Data is available to be read; for listening sockets, a connect is pending.
390 const TUint KSockSelectRead =0x00000001;
391 /** Writing to the socket is not currently blocked by flow-control. */
392 const TUint KSockSelectWrite =0x00000002;
393 /** An error has occurred. */
394 const TUint KSockSelectExcept =0x00000004;
395 /** Include tail of prior read datagram as available data (ie indicates next read will be with read continuation) */
396 const TUint KSockSelectReadContinuation = 0x01000000;
398 // Socket write flags
399 /** The data to be sent is urgent and is given a higher priority than ordinary data in the send queue.
400 KSockWriteUrgent may only be provided as a flag to Send() if the protocol's information flag is marked with
401 KSIUrgentData, otherwise Send() will return with KErrNotSupported. AKA: Out of band or unit data.
404 const TUint KSockWriteUrgent=0x00000001;
405 /** Must not be set for client requests. */
406 const TUint KSocketInternalWriteBit=0x80000000;
407 /** The top 8 bits are reserved for system purposes; protocols must not define these bits. */
408 const TUint KSockWriteSystemMask=0xFF000000;
411 /** Read data without consuming it, data remains in the receive queue. KSockReadPeek may only be provided
412 as a flag to Recv() if the protocol's information flag is marked with KSIPeekData, otherwise Recv() will
413 return with KErrNotSupported.
417 const TUint KSockReadPeek=0x00000001;
418 /** Must not be set for client requests. */
419 const TUint KSocketInternalReadBit=0x80000000;
420 /** Read from datagram in a stream-like fashion (not discarding tails). */
421 const TUint KSockReadContinuation = 0x01000000;
424 /** Used in structure TProtocolDesc to describes the endianness of a protocol.
433 /** Other byte order */
438 // Protocol Service information bitmasks.
439 // The following constants are defined for
440 // TServerProtocolDesc and TProtocolDesc
442 /** The protocol is connectionless.
445 const TUint KSIConnectionLess=0x00000001;
446 /** The protocol is reliable. */
447 const TUint KSIReliable=0x00000002;
448 /** The protocol guarantees in-order delivery. */
449 const TUint KSIInOrder=0x00000004;
450 /** The protocol is message based. */
451 const TUint KSIMessageBased=0x00000008;
452 /** The same as message based. */
453 const TUint KSIDatagram=KSIMessageBased;
454 /** The protocol is stream based. */
455 const TUint KSIStreamBased=0x00000010;
456 /** The protocol supports a stream like interface but maintains datagram boundaries. */
457 const TUint KSIPseudoStream=0x00000020;
458 /** The protocol offers an expedited data service. */
459 const TUint KSIUrgentData=0x00000040;
460 /** The protocol can send user data on a connection request. */
461 const TUint KSIConnectData=0x00000080;
462 /** The protocol can send user data on a disconnect request. */
463 const TUint KSIDisconnectData=0x00000100;
464 /** The protocol supports broadcast addresses. */
465 const TUint KSIBroadcast=0x00000200;
466 /** The protocol supports point to multi-point connections. */
467 const TUint KSIMultiPoint=0x00000400;
468 /** The protocol supports a quality of service metric. */
469 const TUint KSIQOS=0x00000800;
470 /** The protocol is write only. */
471 const TUint KSIWriteOnly=0x00001000;
472 /** The protocol is read only. */
473 const TUint KSIReadOnly=0x00002000;
474 /** The protocol supports graceful close. */
475 const TUint KSIGracefulClose=0x00004000;
476 /** The same socket can be reconnected if it disconnects (for whatever reason). */
477 const TUint KSICanReconnect=0x00008000;
478 /** Protocol supports peeking (looking at the data without removing it from the
480 const TUint KSIPeekData=0x00010000;
481 /** Protocol is to be informed of the identity of the client (i.e. process ID,
482 thread ID and UID) of each SAP (i.e. Socket Service Provider) created.
483 Note that this value has no meaningful interpretation on the client side.
484 @see KSoOwnerInfo and TSoOwnerInfo */
485 const TUint KSIRequiresOwnerInfo=0x00020000; // SetOption(KSoOwnerInfo) invoked on each SAP
486 /** @internalTechnology */
487 const TUint KSIReserved=0xFFFC0000;
490 // Naming service constants
491 // The following constants are defined for
492 // TServerProtocolDesc and TProtocolDesc
494 /** Protocol supports resolving human readable entity names into network addresses
498 const TUint KNSNameResolution=0x00000001;
499 /** Network naming is hierarchical. */
500 const TUint KNSHierarchicalNaming=0x00000002;
501 /** @deprecated Use KNSHierarchicalNaming instead. */
502 const TUint KNSHeirarchicalNaming=KNSHierarchicalNaming;
503 /** Addressing is dynamic and should be attempted every time before connecting
505 const TUint KNSRemoteDiscovery=0x00000004;
506 /** Protocol supports service name to port number resolution. (For example, you
507 can look up TCP to get port 48.) */
508 const TUint KNSServiceResolution=0x00000008;
509 /** Protocol supports additions to the name database. */
510 const TUint KNSNameRegistration=0x00000010;
511 /** Protocol supports additions to the service database. */
512 const TUint KNSServiceRegistration=0x00000020;
513 /** Addressing is dynamic - i.e. name to address mapping may change (like IrDA
514 which randomly chooses machine addresses.) */
515 const TUint KNSDynamicAddressing=0x00000040;
516 /** Protocol has another database which is defined by the protocol. */
517 const TUint KNSInfoDatabase=0x00000080;
518 /** Protocol may request Socket Server to startup a connection on its behalf (via
519 the KErrCompletion error code)
520 Note that this value has no meaningful interpretation on the client side.
522 const TUint KNSRequiresConnectionStartup=0x00000100;
523 /** @internalTechnology */
524 const TUint KNSReserved=0xFFFFFE00;
527 // The following constants are defined for
528 // TServerProtocolDesc and TProtocolDesc
532 const TUint KSocketNoSecurity=0x00000000;
533 /** Secure Sockets Layer.
535 @see CSecureSocket */
536 const TUint KSecureSockets=0x00000001;
538 // Special message sizes
539 // The following constants are defined for
540 // TServerProtocolDesc and TProtocolDesc
541 /** Reads and writes can be of any size: the data is treated as a stream.
544 const TInt KSocketMessageSizeIsStream=0;
545 /** Depends on lower layer or is dynamic. */
546 const TInt KSocketMessageSizeUndefined=1;
547 /** Data is packet-oriented but packets can be of any size (i.e. the remote end
548 must specify a Read of the same size as your Write, but there is no limit
550 const TInt KSocketMessageSizeNoLimit=-1;
553 /** Undefined socket type.
556 const TUint KUndefinedSockType=0xFFFFFFFF;
559 /** Undefined socket type.
562 const TUint KUndefinedProtocol=0xFFFFFFFE;
564 /** Undefined address family
568 const TUint KUndefinedAddressFamily = 0;
570 /** Contains the name of a protocol in structure TProtocolDesc.
573 typedef TBuf<0x20> TProtocolName;
574 /** Defines a descriptor to hold a service name string. */
575 typedef TBuf<0x20> TServiceName;
576 /** Defines a descriptor to hold a host name string. */
577 typedef TBuf<0x100> THostName;
580 Socket protocol information for use by clients
586 /** Socket protocol information for use by clients. */
589 /** The name of the protocol
591 @see TProtocolName */
593 /** An integer identifying the protocol's address family. For example, for TCP/IP
594 protocols, KAfInet. */
596 /** An integer specifying the socket type. For example, for TCP, KSockStream. */
598 /** An integer specifying the specific protocol. For example, for TCP, KProtocolInetTcp. */
600 /** The version of the protocol
604 /** The byte order that the protocol uses
607 TByteOrder iByteOrder;
608 /** A bit mask of service information flags.
610 @see KSockStream etc. */
612 /** A bit mask indicating if the protocol supports name resolution, service resolution,
613 or database access services.
615 @see KNSNameResolution etc. */
616 TUint iNamingServices;
617 /** A bitmask of security flags.
619 @see KSocketNoSecurity etc. */
621 /** The message size of datagram protocols.
623 @see KSocketMessageSizeIsStream etc. */
628 /** This error is returned from operations on non-blocking sockets that cannot
629 be completed immediately, for example receive when no data is queued for reading.
630 It is a non-fatal error, and the operation should be retried later.
633 const TInt KErrWouldBlock=-1000;
638 The value -17210 is taken from the range allocated for Esock (beginning at -17200)
639 A gap has been left between the currently existing vals and this one.
644 const TInt KErrConnectionTerminated=-17210;
646 const TInt KErrCannotFindProtocol = Den::KErrPlayerNotFound;
647 const TInt KErrTierNotFound = -17212;
648 const TInt KErrConnectionContention = -17213;
651 The protocol requested for the socket was recognised but was not able to be used.
652 This can happen with protocols that require specific settings to have been prepared
653 prior to the socket being opened.
658 const TInt KErrProtocolNotReady = -17214;
660 // -17215 used for non published error. Do not use here.
663 /** Used in RSocket read and write calls to pass the length of data read and written.
666 typedef TPckgBuf<TInt> TSockXfrLength;
678 NONSHARABLE_CLASS(RCommsSession) : public RSessionBase
680 friend class RCommsApiExtensionBase;
681 friend class CCommsSessionApiExtProvider;
684 class RSocketServ : public RCommsSession
685 /** Provides the Connect() function to create an IPC communication channel to the
686 socket server. To close the channel RHandleBase provides a RHandleBase::Close()
689 The prime use for instances of RSocketServ is to establish subsession communications
690 for RSocket, RHostResolver, RNetDatabase and RConnection. Any of the resources
691 which are open using the session are automatically closed when the session is
692 terminated, however it is more appropriate to issue a Close() on each subsession object
693 before closing the session.
695 The following operations are also provided:
697 NumProtocols() - enumerates the number of protocols of which the socket server
700 GetProtocolInfo()/FindProtocol() - return information about a specific protocol.
702 StartProtocol() - loads a protocol asynchronously.
704 @note This class is not intended for user derivation.
709 IMPORT_C RSocketServ();
710 IMPORT_C TInt Connect(TUint aMessageSlots=KESockDefaultMessageSlots);
711 IMPORT_C TInt Connect(const TSessionPref& aPref, TUint aMessageSlots=KESockDefaultMessageSlots);
712 IMPORT_C TVersion Version() const;
713 IMPORT_C TInt NumProtocols(TUint& aCount);
714 IMPORT_C TInt GetProtocolInfo(TUint anIndex,TProtocolDesc& aProtocol);
715 IMPORT_C TInt FindProtocol(const TProtocolName& aName,TProtocolDesc& aProtocol);
716 IMPORT_C void StartProtocol(TUint anAddrFamily,TUint aSockType,TUint aProtocol,TRequestStatus& aStatus);
717 IMPORT_C void StopProtocol(TUint anAddrFamily,TUint aSockType,TUint aProtocol,TRequestStatus& aStatus);
718 IMPORT_C TInt InstallExtension(const TDesC& aDllName, const TDesC& aArgs=TPtrC());
719 IMPORT_C void SetExclusiveMode(TRequestStatus& aStatus);
720 IMPORT_C void ClearExclusiveMode();
721 IMPORT_C TInt __DbgMarkHeap();
722 IMPORT_C TInt __DbgCheckHeap(TInt aCount);
723 IMPORT_C TInt __DbgMarkEnd(TInt aCount);
724 IMPORT_C TInt __DbgFailNext(TInt aCount);
725 IMPORT_C TBool __DbgCheckFailNext() const;
726 IMPORT_C TInt __DbgFailNextMbuf(TInt aCount);
727 IMPORT_C TInt __DbgSetMbufPoolLimit(TInt asize);
728 IMPORT_C TInt __DbgCheckMbuf(TInt asize);
729 IMPORT_C TInt __DbgMbufFreeSpace();
730 IMPORT_C TInt __DbgMbufTotalSpace();
731 IMPORT_C TInt __DbgControl(const ESockDebug::TControlMsg& aRequestMsg);
734 NONSHARABLE_CLASS(RCommsSubSession) : public RSubSessionBase
736 friend class RCommsApiExtensionBase;
737 friend class CCommsSubSessionApiExtProvider;
740 class RSubConnection;
741 class RSocket : public RCommsSubSession
742 /** Provides a client endpoint to a protocol. It provides functions for socket
743 creation, reading, writing, passive connection, active connection, setting
744 addresses and querying addresses. Use this class as an endpoint for network
745 type communications. It provides the following services:
747 reading from and writing to protocol
753 passive connection through the listen/accept model
755 Before using any of these services, a connection to a socket server session
756 must have been made and the socket must be open.
759 @released Since v5.0*/
761 friend class RSocketServ;
763 /** Argument to RSocket::Shutdown() specifying how abruptly the shutdown occurs.
767 /** Complete when socket output/input stopped. */
769 /** Stop socket input and complete when output is stopped. */
771 /** Stop socket output and complete when input is stopped. */
773 /** Stop socket input/output and complete (abortive close). */
779 IMPORT_C TInt Open(RSocketServ& aServer,TUint addrFamily,TUint sockType,TUint protocol);
780 IMPORT_C TInt Open(RSocketServ& aServer,TUint addrFamily,TUint sockType,TUint protocol, RConnection& aConnection);
781 IMPORT_C TInt Open(RSocketServ& aServer,TUint addrFamily,TUint sockType,TUint protocol, RSubConnection& aSubConnection);
782 IMPORT_C TInt Open(RSocketServ &aServer,const TDesC& aName);
783 IMPORT_C TInt Open(RSocketServ& aServer);
784 IMPORT_C void Send(const TDesC8& aDesc,TUint someFlags,TRequestStatus& aStatus);
786 IMPORT_C void Send(const TDesC8& aDesc,TUint someFlags,TRequestStatus& aStatus,TSockXfrLength& aLen);
787 IMPORT_C void CancelSend();
789 IMPORT_C void Recv(TDes8& aDesc,TUint flags,TRequestStatus& aStatus);
791 IMPORT_C void Recv(TDes8& aDesc,TUint flags,TRequestStatus& aStatus,TSockXfrLength& aLen);
793 IMPORT_C void RecvOneOrMore(TDes8& aDesc,TUint flags,TRequestStatus& aStatus,TSockXfrLength& aLen);
794 IMPORT_C void RecvOneOrMore(TDes8& aDesc,TUint flags,TRequestStatus& aStatus);
795 IMPORT_C void CancelRecv();
797 IMPORT_C void Read(TDes8& aDesc,TRequestStatus& aStatus);
798 IMPORT_C void CancelRead();
800 IMPORT_C void Write(const TDesC8& aDesc,TRequestStatus& aStatus);
801 IMPORT_C void CancelWrite();
802 IMPORT_C void SendTo(const TDesC8& aDesc,TSockAddr& anAddr,TUint flags,TRequestStatus& aStatus);
804 IMPORT_C void SendTo(const TDesC8& aDesc,TSockAddr& anAddr,TUint flags,TRequestStatus& aStatus,TSockXfrLength& aLen);
806 IMPORT_C void RecvFrom(TDes8& aDesc,TSockAddr& anAddr,TUint flags,TRequestStatus& aStatus);
808 IMPORT_C void RecvFrom(TDes8& aDesc,TSockAddr& anAddr,TUint flags,TRequestStatus& aStatus,TSockXfrLength& aLen);
809 IMPORT_C void Connect(TSockAddr& anAddr,TRequestStatus& aStatus);
810 IMPORT_C void Connect(TSockAddr& anAddr,const TDesC8& aConnectDataOut,TDes8& aConnectDataIn,TRequestStatus& aStatus);
811 IMPORT_C void CancelConnect();
812 IMPORT_C TInt Bind(TSockAddr& anAddr);
813 IMPORT_C TInt SetLocalPort(TInt aPort);
814 IMPORT_C void Accept(RSocket& aBlankSocket,TRequestStatus& aStatus);
815 IMPORT_C void Accept(RSocket& aBlankSocket,TDes8& aConnectData,TRequestStatus& aStatus);
816 IMPORT_C void CancelAccept();
817 IMPORT_C TInt Listen(TUint qSize);
818 IMPORT_C TInt Listen(TUint qSize,const TDesC8& aConnectData);
819 IMPORT_C TInt SetOpt(TUint anOptionName,TUint anOptionLevel,const TDesC8& anOption=TPtrC8(NULL,0));
820 IMPORT_C TInt SetOpt(TUint anOptionName,TUint anOptionLevel,TInt anOption);
821 IMPORT_C TInt GetOpt(TUint anOptionName,TUint anOptionLevel,TDes8& anOption);
822 IMPORT_C TInt GetOpt(TUint anOptionName,TUint anOptionLevel,TInt& anOption);
823 IMPORT_C void Ioctl(TUint aCommand,TRequestStatus& aStatus,TDes8* aDesc=NULL,TUint aLevel=KLevelUnspecified);
824 IMPORT_C void CancelIoctl();
825 IMPORT_C TInt GetDisconnectData(TDes8& aDesc);
826 IMPORT_C void LocalName(TSockAddr& anAddr);
827 IMPORT_C TUint LocalPort();
828 IMPORT_C void RemoteName(TSockAddr& anAddr);
829 IMPORT_C void Close();
830 IMPORT_C void Shutdown(TShutdown aHow,TRequestStatus& aStatus);
831 IMPORT_C void Shutdown(TShutdown aHow,const TDesC8& aDisconnectDataOut,TDes8& aDisconnectDataIn,TRequestStatus& aStatus);
832 IMPORT_C void CancelAll();
833 IMPORT_C TInt Info(TProtocolDesc& aProtocol);
834 IMPORT_C TInt Name(TName& aName);
835 IMPORT_C TInt Transfer(RSocketServ& aServer, const TDesC& aName);
839 /** Contains the results of name queries.
844 inline TNameRecord();
849 EPartial=0x00000002, /*!< Indicates a partial (truncated) host name. */
860 /** Flags indicating some attribute about the name, i.e. EAlias */
864 /** Packages the TNameRecord class so that it can be passed between a client and
868 typedef TPckgBuf<TNameRecord> TNameEntry;
870 class RHostResolver : public RSubSessionBase
871 /** Provides an interface to host name resolution services, such as DNS, that may
872 be provided by particular protocol modules.
874 The interface provides functions to access the following facilities:
876 Obtaining names from addresses.
878 Obtaining addresses from names.
880 Getting and setting local host name.
882 Not all actual services provide all these facilities. You should also consult
883 the documentation on the protocol you are intending to use. Functions return
884 KErrNotSupported if the protocol does not support a given operation. Note
885 that a description of the protocol family name resolution capabilities is
886 available at run-time from TProtocolDesc::iNamingServices.
888 Before using any service, a connection to a socket server session must be
891 Each function is available in both synchronous and asynchronous versions.
893 A single RHostResolver can only perform one request of any type at once. A
894 client is panicked if it makes two requests.
899 IMPORT_C TInt Open(RSocketServ& aSocketServer,TUint anAddrFamily,TUint aProtocol);
900 IMPORT_C TInt Open(RSocketServ& aSocketServer,TUint anAddrFamily,TUint aProtocol, RConnection& aConnection);
901 IMPORT_C void GetByName(const TDesC& aName,TNameEntry& aResult,TRequestStatus& aStatus);
902 IMPORT_C TInt GetByName(const TDesC& aName,TNameEntry& aResult);
903 IMPORT_C void Next(TNameEntry& aResult,TRequestStatus& aStatus);
904 IMPORT_C TInt Next(TNameEntry& aResult);
905 IMPORT_C void GetByAddress(const TSockAddr& anAddr,TNameEntry& aResult,TRequestStatus& aStatus);
906 IMPORT_C TInt GetByAddress(const TSockAddr& anAddr,TNameEntry& aResult);
907 IMPORT_C TInt GetHostName(TDes& aName);
908 IMPORT_C void GetHostName(TDes& aName,TRequestStatus& aStatus);
909 IMPORT_C TInt SetHostName(const TDesC& aName);
910 IMPORT_C void Close();
911 IMPORT_C void Cancel();
913 IMPORT_C void Query(const TDesC8& aQuery, TDes8& aResult, TRequestStatus& aStatus);
914 IMPORT_C TInt Query(const TDesC8& aQuery, TDes8& aResult);
915 IMPORT_C void QueryGetNext(TDes8& aResult, TRequestStatus& aStatus);
916 IMPORT_C TInt QueryGetNext(TDes8& aResult);
917 IMPORT_C TInt SetOpt(TUint anOptionName,TUint anOptionLevel,const TDesC8& anOption=TPtrC8(NULL,0));
923 Port number on service
928 typedef TPckgBuf<TInt> TPortNum;
930 class RServiceResolver : public RSubSessionBase
931 /** Provides an interface to resolver service names and ports.
936 IMPORT_C TInt Open(RSocketServ& aSocketServer,TUint anAddrFamily,TUint sockType,TUint aProtocol);
937 IMPORT_C void GetByName(const TDesC& aName,TPortNum& aPort,TRequestStatus& aStatus);
938 IMPORT_C TInt GetByName(const TDesC& aName,TPortNum& aPort);
939 IMPORT_C void GetByNumber(const TUint aPort,TDes& aName,TRequestStatus& aStatus);
940 IMPORT_C TInt GetByNumber(const TUint aPort,TDes& aName);
941 IMPORT_C void RegisterService(const TDesC& aName,const TUint& aPort,TRequestStatus& aStatus);
942 IMPORT_C TInt RegisterService(const TDesC& aName,const TUint& aPort);
943 IMPORT_C void RemoveService(const TDesC& aName,const TUint& aPort,TRequestStatus& aStatus);
944 IMPORT_C TInt RemoveService(const TDesC& aName,const TUint& aPort);
945 IMPORT_C void Close();
946 IMPORT_C void Cancel();
950 class RNetDatabase: public RSubSessionBase
951 /** Provides an interface to network databases, such as LM-IAS with IrDA, that
952 may be provided by particular protocol modules.
954 Before making any queries, a connection to a socket server session must be
957 Each function is available in both synchronous and asynchronous versions.
959 A single RNetDatabase can only perform one request of any type at once. A
960 client is panicked if it makes two requests.
962 Particular database access services will specify the format of queries and
968 IMPORT_C TInt Open(RSocketServ& aSocketServer,TUint anAddrFamily,TUint aProtocol);
969 IMPORT_C void Query(const TDesC8& aQuery,TDes8& aResult,TRequestStatus& aStat);
970 IMPORT_C TInt Query(const TDesC8& aQuery,TDes8& aResult);
971 IMPORT_C void Add(const TDesC8& anItem,TRequestStatus& aStat);
972 IMPORT_C TInt Add(const TDesC8& anItem);
973 IMPORT_C void Remove(const TDesC8& anItem,TRequestStatus& aStat);
974 IMPORT_C TInt Remove(const TDesC8& anItem);
975 IMPORT_C void Close();
976 IMPORT_C void Cancel();
982 Default connection type
986 const TUint KConnectionTypeDefault = 0x0800; // KAfInet is the default connection type
990 class TSubConnectionInfo;
991 class TSubConnectionEvent;
993 class RConnection : public RCommsSubSession
996 The management interface for a network connection or subconnection.
998 Provides clients with the following functionality:
1000 Opening and closing the connection
1002 Starting a connection, which means associating it with a new underlying interface
1004 Attaching the RConnection instance to an existing interface
1006 Stopping the connection, which means disassociating it from the underlying
1009 Obtaining progress information and notification during connection start-up
1011 Notifying when subconnections come up and go down
1013 Notifying when there is a service change for the connection
1015 Notifying when a given amount of data has been sent or received on a connection
1018 Reading CommDB fields specific to an active connection
1020 Collecting statistical information on the network connection and subconnections.
1021 A UI component can display the collected statistical information in order
1022 to allow the user to examine the status of connections. The information that
1023 can be gathered is the following:
1025 All available internet access point names and internet access point 'friendly'
1026 names as appropriate for each network (GPRS/UMTS) connection
1028 Enumerating the currently active connections and subconnections
1030 The current status of all network connections e.g. active/suspended
1032 The amount of data (in bytes) transferred uplink and downlink by the network
1033 connection and subconnections
1035 The amount of time each network connection has been active (in seconds)
1037 The current status of the connection and subconnections with respect to data
1038 transfer, i.e. active/inactive
1040 The Quality of Service profile associated with each Packet Data Protocol (GPRS/UMTS)
1041 context, e.g. low/medium/high
1043 Note that several of the new functions are asynchronous. It is essential for
1044 these calls that the client ensures that the parameters they pass to the RConnection
1045 API remain in scope for the duration of the asynchronous call.
1047 @released since v7.0s */
1050 /** Identifies the intended use of the connection. */
1051 enum TConnAttachType
1053 /** The application wishes to use the connection for normal data transfer, and
1054 the idle timers will take that into account. */
1056 /** The system control type of application wishes to monitor the state of the connection
1057 without otherwise affecting it. In particular, the interface idle timers will
1061 /** Identifies the type of requirement for stopping the connection. */
1064 /** Any sockets or host/service resolvers associated with this interface will be
1065 errored with KErrCancel. */
1069 /** Any sockets or host/service resolvers associated with this interface will be
1070 errored with KErrConnectionTerminated and should clean up quietly without
1071 prompting the user. */
1077 Connection Management Interface
1079 IMPORT_C RConnection();
1080 IMPORT_C virtual ~RConnection();
1081 IMPORT_C TInt Open(RSocketServ& aSocketServer, TUint aConnectionType = KConnectionTypeDefault);
1082 IMPORT_C TInt Open(RSocketServ& aSocketServer, TName& aName);
1083 IMPORT_C void Close();
1085 IMPORT_C void Start(TRequestStatus& aStatus);
1086 IMPORT_C void Start(TConnPref& aPref, TRequestStatus& aStatus);
1087 IMPORT_C TInt Start();
1088 IMPORT_C TInt Start(TConnPref& aPref);
1089 IMPORT_C TInt Stop();
1090 IMPORT_C TInt Stop(TConnStopType aStopType);
1091 IMPORT_C TInt Stop(TSubConnectionUniqueId aSubConnectionUniqueId);
1092 IMPORT_C TInt Stop(TSubConnectionUniqueId aSubConnectionUniqueId, TConnStopType aStopType);
1094 IMPORT_C void WaitForIncoming(RSubConnection& aIncomingSubConnection, TRequestStatus& aStatus);
1095 IMPORT_C TInt WaitForIncoming(RSubConnection& aIncomingSubConnection);
1096 IMPORT_C void CancelWaitForIncoming();
1098 IMPORT_C void ProgressNotification(TNifProgressBuf& aProgress, TRequestStatus& aStatus, TUint aSelectedProgress = KConnProgressDefault);
1099 IMPORT_C void ProgressNotification(TSubConnectionUniqueId aSubConnectionUniqueId, TNifProgressBuf& aProgress, TRequestStatus& aStatus, TUint aSelectedProgress = KConnProgressDefault);
1100 IMPORT_C void CancelProgressNotification();
1101 IMPORT_C void CancelProgressNotification(TSubConnectionUniqueId aSubConnectionUniqueId);
1102 IMPORT_C TInt Progress(TNifProgress& aProgress);
1103 IMPORT_C TInt Progress(TSubConnectionUniqueId aSubConnectionUniqueId, TNifProgress& aProgress);
1104 IMPORT_C TInt LastProgressError(TNifProgress& aProgress);
1105 IMPORT_C void ServiceChangeNotification(TUint32& aNewISPId, TDes& aNewServiceType, TRequestStatus& aStatus);
1106 IMPORT_C void CancelServiceChangeNotification();
1110 @deprecated Since SymbianOS v9.5
1112 IMPORT_C TInt GetIntSetting(const TDesC& aSettingName, TUint32& aValue);
1115 @deprecated Since SymbianOS v9.5
1117 IMPORT_C TInt GetBoolSetting(const TDesC& aSettingName, TBool& aValue);
1120 @deprecated Since SymbianOS v9.5
1122 IMPORT_C TInt GetDesSetting(const TDesC& aSettingName, TDes8& aValue);
1125 @deprecated Since SymbianOS v9.5
1127 IMPORT_C TInt GetDesSetting(const TDesC& aSettingName, TDes16& aValue);
1130 @deprecated Since SymbianOS v9.5
1132 IMPORT_C TInt GetLongDesSetting(const TDesC& aSettingName, TDes& aValue);
1135 IMPORT_C TInt GetParameters(ESock::CCommsDataObjectBase& aDataObject);
1136 IMPORT_C TInt SetParameters(ESock::CCommsDataObjectBase& aDataObject);
1138 IMPORT_C TInt Name(TName& aName);
1140 IMPORT_C TInt EnumerateConnections(TUint& aCount);
1141 IMPORT_C TInt GetConnectionInfo(TUint aIndex, TDes8& aConnectionInfo);
1143 IMPORT_C void AllInterfaceNotification(TDes8& aNotification, TRequestStatus& aStatus);
1144 IMPORT_C void CancelAllInterfaceNotification();
1146 IMPORT_C void Ioctl(TUint aOptionLevel, TUint aOptionName, TRequestStatus& aStatus, TDes8* aDesc);
1147 IMPORT_C void Ioctl(TUint aOptionLevel, TUint aOptionName, TRequestStatus& aStatus);
1148 IMPORT_C void CancelIoctl();
1149 IMPORT_C TInt Control(TUint aOptionLevel, TUint aOptionName, TDes8& aOption);
1150 IMPORT_C TInt GetOpt(TUint aOptionLevel, TUint aOptionName, TInt& aOption);
1151 IMPORT_C TInt SetOpt(TUint aOptionLevel, TUint aOptionName, TInt aOption = 0);
1153 IMPORT_C TInt Attach(const TDesC8& aConnectionInfo, TConnAttachType aAttachType);
1155 IMPORT_C TInt EnumerateSubConnections(TUint& aCount);
1156 IMPORT_C TInt GetSubConnectionInfo(TDes8& aSubConnectionInfo);
1157 IMPORT_C TInt GetSubConnectionInfo(TUint aIndex, TDes8& aSubConnectionInfo);
1158 IMPORT_C void AllSubConnectionNotification(TSubConnectionNotificationBuf& aSubConnectionEvent, TRequestStatus& aStatus);
1159 IMPORT_C void CancelAllSubConnectionNotification();
1161 IMPORT_C void DataTransferredRequest(TPckg<TUint>& aUplinkVolume, TPckg<TUint>& aDownlinkVolume, TRequestStatus& aStatus);
1162 IMPORT_C void DataTransferredRequest(TSubConnectionUniqueId aSubConnectionUniqueId, TPckg<TUint>& aUplinkVolume, TPckg<TUint>& aDownlinkVolume, TRequestStatus& aStatus);
1163 IMPORT_C void DataTransferredCancel();
1164 IMPORT_C void DataTransferredCancel(TSubConnectionUniqueId aSubConnectionUniqueId);
1165 IMPORT_C void DataSentNotificationRequest(TUint aThreshold, TPckg<TUint>& aUplinkVolume, TRequestStatus& aStatus);
1166 IMPORT_C void DataSentNotificationRequest(TSubConnectionUniqueId aSubConnectionUniqueId, TUint aThreshold, TPckg<TUint>& aUplinkVolume, TRequestStatus& aStatus);
1167 IMPORT_C void DataSentNotificationCancel();
1168 IMPORT_C void DataSentNotificationCancel(TSubConnectionUniqueId aSubConnectionUniqueId);
1169 IMPORT_C void DataReceivedNotificationRequest(TUint aThreshold, TPckg<TUint>& aDownlinkVolume, TRequestStatus& aStatus);
1170 IMPORT_C void DataReceivedNotificationRequest(TSubConnectionUniqueId aSubConnectionUniqueId, TUint aThreshold, TPckg<TUint>& aDownlinkVolume, TRequestStatus& aStatus);
1171 IMPORT_C void DataReceivedNotificationCancel();
1172 IMPORT_C void DataReceivedNotificationCancel(TSubConnectionUniqueId aSubConnectionUniqueId);
1173 IMPORT_C void IsConnectionActiveRequest(TUint aSecs, TPckg<TBool>& aState, TRequestStatus& aStatus);
1174 IMPORT_C void IsConnectionActiveCancel();
1175 IMPORT_C void IsSubConnectionActiveRequest(TSubConnectionUniqueId aSubConnectionUniqueId, TUint aSecs, TPckg<TBool>& aState, TRequestStatus& aStatus);
1176 IMPORT_C void IsSubConnectionActiveCancel(TSubConnectionUniqueId aSubConnectionUniqueId);
1178 TBool SameSession(TInt aSessionHandle);
1180 TPckg<TUint32> iNewISPId;
1181 TUint32 iReserved[4];
1184 class CSubConParameterSet : public XParameterSetBase
1185 /** Base class for all RSubConnection parameter sets.
1187 THIS API IS DEPRECATED IN FAVOUR OF XParameterSet
1190 @deprecated since v9.6 */
1193 IMPORT_C static CSubConParameterSet* NewL(const STypeId& aTypeId);
1194 virtual ~CSubConParameterSet();
1197 CSubConParameterSet();
1201 class CSubConGenericParameterSet : public CSubConParameterSet
1202 /** Base class for generic RSubConnection parameter sets.
1204 THIS API IS DEPRECATED IN FAVOUR OF XParameterSet
1207 @deprecated since v9.6 */
1210 IMPORT_C ~CSubConGenericParameterSet();
1213 IMPORT_C CSubConGenericParameterSet();
1216 class CSubConExtensionParameterSet : public CSubConParameterSet
1217 /** Base class for extended RSubConnection parameter sets.
1219 THIS API IS DEPRECATED IN FAVOUR OF XParameterSet
1222 @deprecated since v9.6 */
1225 IMPORT_C ~CSubConExtensionParameterSet();
1228 IMPORT_C CSubConExtensionParameterSet();
1231 class RSubConParameterBundle;
1232 class CSubConParameterBundle;
1234 const TInt32 KSubConnParamsInterfaceUid = 0x10204303;
1235 const TInt32 KSubConnEventInterfaceUid = 0x10204305;
1237 const TInt32 KSubConnGenericParamsImplUid = 0x10204304;
1238 const TInt32 KSubConnGenericEventsImplUid = 0x10204306;
1240 const TUint32 KSubConGlobalFamily = 0;
1241 const TUint32 KSubConQoSFamily = 1;
1242 const TUint32 KSubConAuthorisationFamily = 2;
1243 const TUint32 KSubConnCallDescrParamsFamily = 3;
1244 const TUint32 KSubConnContextDescrParamsFamily = 4;
1246 const TUint32 KSubConIPAddressInfoFamily = 5;
1248 const TInt32 KProtocolExtensionFamily = 6;
1249 const TInt32 KFlowParametersFamily = 7;
1250 class RParameterFamily;
1252 class CSubConParameterFamily : public CBase
1253 /** Container of RSubConnection parameter sets.
1255 For each Parameter Type (Requested, Acceptable and Granted) it
1256 contains one generic and 0..N extended parameter sets.
1259 a CSubConParameterBundle or RSubConParameterBundle object can take ownership of a
1260 CSubConParameterFamily object, in this case, when the bundle is destroyed, this
1261 family object will also be destroyed (along with any parameter sets that are owned
1264 THIS API IS DEPRECATED IN FAVOUR OF RParameterFamily
1267 @deprecated since v9.6 */
1271 enum TParameterSetType
1276 ENumValues = 3 // The number of values in this enum
1280 IMPORT_C static CSubConParameterFamily* NewL(RSubConParameterBundle& aBundle, TUint32 aFamilyId);
1281 IMPORT_C static CSubConParameterFamily* LoadL(RSubConParameterBundle& aBundle, TPtrC8& aBuffer);
1282 IMPORT_C static CSubConParameterFamily* NewL(CSubConParameterBundle& aBundle, TUint32 aFamilyId);
1283 IMPORT_C static CSubConParameterFamily* LoadL(CSubConParameterBundle& aBundle, TPtrC8& aBuffer);
1286 IMPORT_C virtual ~CSubConParameterFamily();
1287 IMPORT_C void SetGenericSetL(CSubConGenericParameterSet& aGenericSet, TParameterSetType aType);
1288 IMPORT_C void AddExtensionSetL(CSubConExtensionParameterSet& aExtensionSet, TParameterSetType aType);
1290 IMPORT_C CSubConExtensionParameterSet* FindExtensionSet(TUid aSetId, TParameterSetType aType);
1291 IMPORT_C CSubConExtensionParameterSet* FindExtensionSet(STypeId aSetId, TParameterSetType aType);
1292 IMPORT_C CSubConGenericParameterSet* GetGenericSet(TParameterSetType aType);
1294 inline TUint32 Id();
1296 IMPORT_C TUint Length() const;
1297 IMPORT_C TInt Load(TPtrC8& aDes);
1298 IMPORT_C TInt Store(TDes8& aDes) const;
1299 IMPORT_C void ClearAllParameters(TParameterSetType aType);
1302 Copy the parameters of this CSubConParameterFamily to a RParameterFamily.
1303 @param aDest RParameterFamily object to copy to
1305 void CopyToFamilyL(RParameterFamily& aDest) const;
1308 Copy the parameters of this CSubConParameterFamily from a RParameterFamily.
1309 @param aSrc RParameterFamily object to copy from
1311 void CopyFromFamilyL(RParameterFamily& aSrc);
1313 IMPORT_C explicit CSubConParameterFamily(TUint32 aFamilyId);
1314 IMPORT_C void ConstructL(RSubConParameterBundle& aBundle);
1315 IMPORT_C void ConstructL(CSubConParameterBundle& aBundle);
1317 IMPORT_C static TInt32 ExtractFamilyAndCreateBufferL(TPtrC8& aBuffer, TPtrC8& aContainerBuffer);
1320 const TUint32 iFamilyId; // This member variable is accessed by an inline function ( Id () ).
1321 RMetaDataEComContainer iGenericSets;
1323 RMetaDataEComContainer iExtensionSets[ENumValues];
1327 class RParameterFamilyBundle;
1328 class RSubConParameterBundle
1329 /** Container for (bundle of) SubConnection parameter families.
1331 May contain and 0..N SubConnection parameter families.
1334 If the RSubConParameterBundle object takes ownership of any CSubConParameterFamily object,
1335 then when the bundle object is destroyed, any family owned by this object will also be
1338 THIS API IS DEPRECATED IN FAVOUR OF RParameterFamilyBundle
1341 @deprecated since v9.6 */
1344 IMPORT_C RSubConParameterBundle();
1345 IMPORT_C void Close();
1347 IMPORT_C TUint Length() const;
1348 IMPORT_C TInt Load(const TDesC8& aDes);
1349 IMPORT_C TInt Store(TDes8& aDes) const;
1350 IMPORT_C void AddFamilyL(CSubConParameterFamily* aFamily);
1351 IMPORT_C CSubConParameterFamily* FindFamily(TUint32 aFamilyId);
1352 IMPORT_C void ClearAllParameters(CSubConParameterFamily::TParameterSetType aType);
1355 Copy the contents of this parameter bundle to a RParameterFamilyBundle.
1356 @param aDest RParameterFamilyBundle to copy parameters to
1358 void CopyToFamilyBundleL(RParameterFamilyBundle& aDest) const;
1361 Copy the contents of an RParameterFamilyBundle to this RSubConParameterBundle
1362 @param aSrc RParameterFamilyBundle to copy contents from
1364 void CopyFromFamilyBundleL(RParameterFamilyBundle& aSrc);
1367 TInt CheckBundle() const;
1369 RSubConParameterBundle(const RSubConParameterBundle& aBundle);
1370 RSubConParameterBundle& operator=(const RSubConParameterBundle& aBundle);
1373 mutable CSubConParameterBundle* iBundle;
1377 const TInt KNotificationEventMaxSize = 2048;
1378 class TNotificationEventBuf : public TBuf8<KNotificationEventMaxSize>
1380 Buffer for Sub-connection event notiifcation
1387 IMPORT_C TNotificationEventBuf();
1388 IMPORT_C ~TNotificationEventBuf();
1390 IMPORT_C TBool IsGeneric() const;
1391 IMPORT_C TInt32 GroupId() const;
1392 IMPORT_C TUint32 Id() const;
1395 #ifndef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
1396 class CSubConNotificationEvent : public SMetaDataECom
1398 class CSubConNotificationEvent : public ESock::XEventBase
1399 #endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
1402 IMPORT_C static CSubConNotificationEvent* NewL(const STypeId& aTypeId);
1403 IMPORT_C static CSubConNotificationEvent* NewL(const TNotificationEventBuf& aEventBuffer);
1405 IMPORT_C TBool IsGeneric() const;
1406 IMPORT_C TInt32 GroupId() const;
1407 IMPORT_C TUint32 Id() const;
1413 /** @internalComponent */
1416 /** Defines the type of a subconnection */
1419 EAttachToDefault, // will attach to the default sub connection
1420 ECreateNew, // will create a new sub connection
1422 //private extension to subconnection openning modes below:
1431 class RSubConnection : public RCommsSubSession
1432 /** A Sub-Connection, a channel within a Connection. A representation of a channel between this device and remote devices with which we are communicating. This channel will be used by one or more sockets.
1433 Depending on the state of the channel, it may not be possible to bind arbitary sockets into it. Attempts to bind sockets from different protocol families to a single channel is an error, as each channel can only be used by one protocol family.
1434 @note The sub-connection can represent a end-to-end channel and/or a channel from this device to an intermediate device (e.g an access server such as a GGSN which using UMTS and PDP contexts. Properties can be specified simultaneously on protocol and link level.)
1436 Before using any of these services, a connection to a socket server session
1437 must have been made and the connection must be open.
1440 @released Since v9.0*/
1443 friend class RConnection;
1454 inline TEventFilter(TInt32 aEventGroupId = KSubConnGenericEventsImplUid, TUint32 aEventMask = 0xffffffff);
1455 TInt32 iEventGroupUid;
1460 // Sub Connection Management
1461 IMPORT_C RSubConnection();
1462 IMPORT_C TInt Open(RSocketServ& aServer, TSubConnType aSubConnType, RConnection& aConnection);
1463 IMPORT_C void Close();
1464 IMPORT_C void Start(TRequestStatus& aStatus);
1465 IMPORT_C TInt Start();
1466 IMPORT_C TInt Stop();
1468 // Socket Management
1469 IMPORT_C void Add(RSocket& aSocket, TRequestStatus& aStatus);
1470 IMPORT_C void Remove(RSocket& aSocket, TRequestStatus& aStatus);
1472 // QoS Properties (legacy bundles - to be deprecated)
1473 IMPORT_C TInt SetParameters(const RSubConParameterBundle& aParametersSet);
1474 IMPORT_C TInt GetParameters(RSubConParameterBundle& aParametersSet);
1476 // QoS Properties (new prototype bundles)
1477 IMPORT_C TInt SetParameters(const RParameterFamilyBundle& aParametersSet);
1478 IMPORT_C TInt GetParameters(RParameterFamilyBundle& aParametersSet);
1480 // Event Notification
1481 IMPORT_C void EventNotification(TNotificationEventBuf& aEventBuffer, TBool aGenericEventsOnly, TRequestStatus& aStatus);
1482 IMPORT_C void EventNotification(TNotificationEventBuf& aEventBuffer, TEventFilter aEventFilterList[], TUint aEventListLength, TRequestStatus& aStatus);
1483 IMPORT_C void CancelEventNotification();
1486 IMPORT_C TInt Control(TUint aOptionLevel, TUint aOptionName, TDes8& aOption);
1489 // IMPORT_C TInt Stop(TConnStopType aStopType);
1490 // IMPORT_C void ProgressNotification(TNifProgressBuf& aProgress, TRequestStatus& aStatus, TUint aSelectedProgress = KConnProgressDefault);
1491 // IMPORT_C void CancelProgressNotification();
1492 // IMPORT_C TInt Progress(TNifProgress& aProgress);
1493 // IMPORT_C void IsSubConnectionActiveRequest(TUint aSecs, TPckg<TBool>& aState, TRequestStatus& aStatus);
1494 // IMPORT_C void IsSubConnectionActiveCancel();
1497 TBool SameSession(TInt aSessionHandle);
1500 IMPORT_C TInt Open(RSocketServ& aServer, TSubConnOpen::TSubConnType aSubConnType, RConnection& aConnection);
1502 //Note : Not used anywhere else in the code, kept in order to avoid the BC Break
1508 /** Reverses the byte order in 16 and 32-bit values.
1513 IMPORT_C static TUint32 Swap32(TUint32 aVal);
1514 IMPORT_C static TUint16 Swap16(TUint16 aVal);
1515 inline static TUint16 Swap16(TUint aVal);
1519 /** Inserts and extracts integers in big-endian format.
1524 IMPORT_C static TUint32 Get32(const TUint8* aPtr);
1525 IMPORT_C static TUint16 Get16(const TUint8* aPtr);
1526 IMPORT_C static void Put32(TUint8* aPtr, TUint32 aVal);
1527 IMPORT_C static void Put16(TUint8* aPtr, TUint16 aVal);
1531 /** Inserts and extracts integers in little-endian format.
1536 IMPORT_C static TUint32 Get32(const TUint8* aPtr);
1537 IMPORT_C static TUint16 Get16(const TUint8* aPtr);
1538 IMPORT_C static void Put32(TUint8* aPtr, TUint32 aVal);
1539 IMPORT_C static void Put16(TUint8* aPtr, TUint16 aVal);
1542 class TAccessPointInfo
1543 /** Stores Access Point information.
1549 TAccessPointInfo(TUint aApId = 0);
1551 TUint AccessPoint() const;
1552 void SetAccessPoint(TUint aAccessPoint);
1554 TBool operator== (const TAccessPointInfo& aRhs) const;
1556 TUint iAccessPointId;
1560 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
1561 #include <es_sock_internal.h>
1562 #include <es_sock_partner.h>
1565 #include <es_sock.inl>
1567 #endif //__ES_SOCK_H__