• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 
19 #ifndef OSCL_SOCKET_SEND_H_INCLUDED
20 #define OSCL_SOCKET_SEND_H_INCLUDED
21 
22 #include "oscl_socket_types.h"
23 #include "oscl_socket_method.h"
24 
25 /**
26   Internal implementation of Send
27   */
28 class OsclSendRequest;
29 
30 class OsclSendMethod : public OsclSocketMethod
31 {
32     public:
33         static OsclSendMethod *NewL(OsclIPSocketI& c);
34 
35         ~OsclSendMethod();
36 
37         TPVSocketEvent Send(const uint8* &aPtr, uint32 aLen,
38                             int32 aTimeout);
39 
40         uint8 *GetSendData(int32 *aLength);
41 
42     private:
OsclSendMethod(OsclIPSocketI & c)43         OsclSendMethod(OsclIPSocketI& c)
44                 : OsclSocketMethod(c, "osclsendmethod", EPVSocketSend)
45         {};
46 
47         void ConstructL();
48 
49     public:
SendRequest()50         OsclSendRequest *SendRequest()
51         {
52             return (OsclSendRequest*)iSocketRequestAO;
53         }
54 };
55 
56 /**
57   This is the AO that interacts with the socket server
58   */
59 class SendParam;
60 class OsclSendRequest : public OsclSocketRequestAO
61 {
62     public:
OsclSendRequest(OsclSocketMethod & c)63         OsclSendRequest(OsclSocketMethod& c)
64                 : OsclSocketRequestAO(c, "osclSendRequest")
65         {}
66 
67 
68         void Send(const uint8* &aPtr, uint32 aLen);
69         void Success();
70         uint8 *GetSendData(int32 *aLength);
71 
72     private:
73 
Param()74         SendParam*Param()
75         {
76             return(SendParam*)iParam;
77         }
78 
79 };
80 
81 
82 
83 
84 #endif
85 
86