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_TO_H_INCLUDED 20 #define OSCL_SOCKET_SEND_TO_H_INCLUDED 21 22 #include "oscl_socket_types.h" 23 #include "oscl_socket_imp.h" 24 #include "oscl_socket_method.h" 25 26 /** 27 Internal implementation of SendTo 28 */ 29 class OsclSendToRequest; 30 31 class OsclSendToMethod : public OsclSocketMethod 32 { 33 public: 34 static OsclSendToMethod *NewL(OsclIPSocketI& c); 35 ~OsclSendToMethod(); 36 37 TPVSocketEvent SendTo(const uint8* &aPtr, uint32 aLen, 38 OsclNetworkAddress& aAddress, 39 int32 aTimeout); 40 41 uint8 *GetSendData(int32 *aLength); 42 43 private: OsclSendToMethod(OsclIPSocketI & c)44 OsclSendToMethod(OsclIPSocketI& c) 45 : OsclSocketMethod(c, "osclsendtomethod", EPVSocketSendTo) 46 {}; 47 48 void ConstructL(); 49 50 public: SendToRequest()51 OsclSendToRequest *SendToRequest() 52 { 53 return (OsclSendToRequest*)iSocketRequestAO; 54 } 55 }; 56 57 /** 58 This is the AO that interacts with the socket server 59 */ 60 class OsclSendToRequest : public OsclSocketRequestAO 61 { 62 public: OsclSendToRequest(OsclSocketMethod & c)63 OsclSendToRequest(OsclSocketMethod& c) 64 : OsclSocketRequestAO(c, "osclSendToRequest") 65 {} 66 67 void SendTo(const uint8* &aPtr, uint32 aLen, OsclNetworkAddress &aAddress); 68 void Success(); 69 70 uint8 *GetSendData(int32 *aLength); 71 72 private: 73 Param()74 SendToParam*Param() 75 { 76 return(SendToParam*)iParam; 77 } 78 }; 79 80 81 82 83 84 #endif 85 86