Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# oscl_socket_imp_base.h

Go to the documentation of this file.

    00001
    00002
    00003 #ifndef OSCL_SOCKET_IMP_BASE_H_INCLUDED
    00004 #define OSCL_SOCKET_IMP_BASE_H_INCLUDED
    00005
    00006 #include "oscl_socket_types.h"
    00007 #include "oscl_socket_request.h"
    00008 #include "oscl_defalloc.h"
    00009 #include "oscl_mutex.h"
    00010 #include "oscl_socket_stats.h"
    00011 #include "oscl_base.h"
    00012
    00013 class OsclSocketServI;
    00014
    00017 class OsclSocketIBase
    00018 {
    00019     public:
    00020         virtual ~OsclSocketIBase();
    00021
    00022         //synchronous methods
    00023         virtual int32 Open(OsclSocketServI& aServer, uint32 addrFamily, uint32 sockType, uint32 protocol) = 0;
    00024         virtual int32 Open(OsclSocketServI& aServer) = 0;
    00025         virtual int32 Bind(OsclNetworkAddress& anAddr) = 0;
    00026         virtual int32 Join(OsclNetworkAddress& anAddr) = 0;
    00027         virtual int32 Close() = 0;
    00028         virtual int32 Listen(uint32 qSize) = 0;
    00029
    00030         //asynchronous methods.
    00031         virtual void Connect(ConnectParam& , OsclSocketRequestAO&) = 0;
    00032
    00033         virtual void Accept(AcceptParam &, OsclSocketRequestAO&) = 0;
    00034
    00035         virtual void Shutdown(ShutdownParam &, OsclSocketRequestAO&) = 0;
    00036
    00037         virtual void Send(SendParam &, OsclSocketRequestAO&) = 0;
    00038         virtual void SendSuccess(SendParam &) = 0;
    00039
    00040         virtual void SendTo(SendToParam & , OsclSocketRequestAO&) = 0;
    00041         virtual void SendToSuccess(SendToParam &) = 0;
    00042
    00043         virtual void Recv(RecvParam &, OsclSocketRequestAO&) = 0;
    00044         virtual void RecvSuccess(RecvParam &) = 0;
    00045
    00046         virtual void RecvFrom(RecvFromParam &, OsclSocketRequestAO&) = 0;
    00047         virtual void RecvFromSuccess(RecvFromParam &) = 0;
    00048
    00049         //optional async methods
    00050         virtual void BindAsync(BindParam&, OsclSocketRequestAO&)
    00051         {}
    00052         virtual void ListenAsync(ListenParam&, OsclSocketRequestAO&)
    00053         {}
    00054         static bool HasAsyncBind() ;
    00055         static bool HasAsyncListen() ;
    00056
    00057         void CancelFxn(TPVSocketFxn);
    00058
    00059     protected:
    00060         OsclSocketIBase(Oscl_DefAlloc &a);
    00061
    00062         virtual void CancelConnect() = 0;
    00063         virtual void CancelAccept() = 0;
    00064         virtual void CancelShutdown() = 0;
    00065         virtual void CancelSend() = 0;
    00066         virtual void CancelSendTo() = 0;
    00067         virtual void CancelRecv() = 0;
    00068         virtual void CancelRecvFrom() = 0;
    00069
    00070         //optional methods, for async bind/listen
    00071         virtual void CancelBind()
    00072         {}
    00073         virtual void CancelListen()
    00074         {}
    00075
    00076         Oscl_DefAlloc &iAlloc;
    00077
    00078         static int GetShutdown(TPVSocketShutdown aOsclVal);
    00079
    00080         virtual bool IsOpen() = 0;
    00081
    00082         //link to socket server.
    00083         OsclSocketServI *iSocketServ;
    00084         friend class OsclSocketRequest;
    00085         friend class OsclSocketMethod;
    00086         friend class OsclSocketRequestAO;
    00087
    00088 #if(PV_OSCL_SOCKET_STATS_LOGGING)
    00089         OsclSocketStats iStats;
    00090 #endif
    00091
    00092         friend class OsclUDPSocket;
    00093         friend class OsclTCPSocket;
    00094 };
    00095
    00096 #endif
    00097
    00098
    00099