• 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_CONNECT_H_INCLUDED
20 #define OSCL_SOCKET_CONNECT_H_INCLUDED
21 
22 #include "oscl_socket_types.h"
23 #include "oscl_socket_serv_imp.h"
24 #include "oscl_socket_imp.h"
25 #include "oscl_socket_method.h"
26 
27 /**
28   Internal implementation of Connect
29   */
30 class OsclConnectRequest;
31 
32 class OsclConnectMethod : public OsclSocketMethod
33 {
34     public:
35         static OsclConnectMethod *NewL(OsclIPSocketI& c);
36 
37         ~OsclConnectMethod();
38 
39         TPVSocketEvent Connect(OsclNetworkAddress& aAddress,
40                                int32 aTimeout);
41 
42     private:
OsclConnectMethod(OsclIPSocketI & c)43         OsclConnectMethod(OsclIPSocketI& c)
44                 : OsclSocketMethod(c, "osclconnectmethod", EPVSocketConnect)
45         {}
46 
47         void ConstructL();
48 
49     public:
ConnectRequest()50         OsclConnectRequest *ConnectRequest()
51         {
52             return (OsclConnectRequest*)iSocketRequestAO;
53         }
54 };
55 
56 /**
57   This is the AO that interacts with the socket server
58   */
59 class OsclConnectRequest : public OsclSocketRequestAO
60 {
61     public:
OsclConnectRequest(OsclSocketMethod & c)62         OsclConnectRequest(OsclSocketMethod& c)
63                 : OsclSocketRequestAO(c, "osclConnectRequest")
64         {}
65 
66         void Connect(OsclNetworkAddress &aAddress);
67 
68     private:
69 
Param()70         ConnectParam*Param()
71         {
72             return(ConnectParam*)iParam;
73         }
74 
75 };
76 
77 
78 #endif
79 
80 
81 
82