00001 00002 #ifndef OSCL_SOCKET_ACCEPT_H_INCLUDED 00003 #define OSCL_SOCKET_ACCEPT_H_INCLUDED 00004 00005 00006 #include "oscl_socket_imp.h" 00007 #include "oscl_socket_serv_imp.h" 00008 #include "oscl_socket_method.h" 00009 00013 class OsclAcceptRequest; 00014 00015 class OsclAcceptMethod : public OsclSocketMethod 00016 { 00017 public: 00018 static OsclAcceptMethod *NewL(OsclIPSocketI& c); 00019 00020 ~OsclAcceptMethod(); 00021 00022 TPVSocketEvent Accept(int32 aTimeout); 00023 00024 void DiscardAcceptedSocket(); 00025 OsclSocketI *GetAcceptedSocket(); 00026 00027 private: 00028 00029 OsclAcceptMethod(OsclIPSocketI &c) 00030 : OsclSocketMethod(c, "osclacceptmethod", EPVSocketAccept) 00031 , iAcceptedSocket(NULL) 00032 {} 00033 00034 void ConstructL(); 00035 00036 void Run(); 00037 00038 OsclSocketServI *SocketServ() 00039 { 00040 return iContainer.SocketServ(); 00041 } 00042 public: 00043 OsclAcceptRequest *AcceptRequest() 00044 { 00045 return (OsclAcceptRequest*)iSocketRequestAO; 00046 } 00047 private: 00048 OsclSocketI *iAcceptedSocket; 00049 }; 00050 00054 class AcceptParam; 00055 00056 class OsclAcceptRequest : public OsclSocketRequestAO 00057 { 00058 public: 00059 OsclAcceptRequest(OsclSocketMethod& c) 00060 : OsclSocketRequestAO(c, "osclacceptreq") 00061 {} 00062 00063 void Accept(OsclSocketI &aSocket); 00064 00065 private: 00066 void Run(); 00067 00068 AcceptParam*Param() 00069 { 00070 return(AcceptParam*)iParam; 00071 } 00072 }; 00073 00074 00075 00076 00077 #endif 00078