00001 /* 00002 * nudpconnection.h,v 1.1 2003/12/27 19:46:23 matti Exp 00003 * 00004 * COBAIN - Communications API for EPOC Environments 00005 * Copyright (C) 2002-2003 Matti Dahlbom, Matti Kokkola 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 * 00021 * Contact: Matti Dahlbom <matti@777-team.org> 00022 * Matti Kokkola <matti.kokkola@iki.fi> 00023 */ 00024 00025 #ifndef __NUDP_CONNECTION_H 00026 #define __NUDP_CONNECTION_H 00027 00028 #include <e32base.h> 00029 00030 #include "concreteconnection.h" 00031 00032 // Size of nanoUDP protocol header in octets 00033 const TInt KNUDPHeaderSize = 5; 00034 00035 // nanoUDP protocol number 00036 const TUint8 KNUDPProtocolNumber = 0; 00037 00038 // Flag value indicating first fragment (0100) 00039 const TUint8 KFirstFragment = 0x4; 00040 00041 // Flag value indicating last fragment (1000) 00042 const TUint8 KLastFragment = 0x8; 00043 00055 class CNUDPConnection : public CConcreteConnection 00056 { 00057 public: 00058 static CNUDPConnection * NewL(RSocket *aSocket, 00059 CServerSession &aSession, 00060 TInt aMtu); 00061 static CNUDPConnection * NewListeningL(RSocket *aSocket, 00062 RSocketServ *aSocketServ, 00063 CServerSession &aSession); 00064 00065 ~CNUDPConnection(); 00066 00067 void ReceiveL(const RMessage &aMessage); 00068 void SendL(TDesC8 *aBuf); 00069 00070 private: 00071 // Functions 00072 CNUDPConnection(RSocket* aSocket, 00073 RSocketServ *aSocketServ, 00074 CServerSession &aSession, 00075 TInt aMtu); 00076 00081 TDesC8 *CreateFrame(TDesC8 *aBuf, TUint8 aFlags, TUint16 aLen); 00082 00083 // Data 00084 TUint8 iSrcPort; 00085 TUint8 iDstPort; 00086 00087 friend class CConcreteConnection; 00088 }; 00089 00090 #endif // __NUDP_CONNECTION
1.3.5