2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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 express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
20 * @brief This file is the header file of unix socket
22 #ifndef DPL_UNIX_SOCKET_H
23 #define DPL_UNIX_SOCKET_H
25 #include <dpl/socket/generic_socket.h>
26 #include <dpl/exception.h>
34 : public GenericSocket<UnixSocket>
40 DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
41 DECLARE_EXCEPTION_TYPE(Base, CreateFailed)
46 * Translate generic Address to specific socket kernel structure
48 virtual std::pair<sockaddr *, socklen_t> TranslateAddressGenericToSpecific(const Address &address) const;
51 * Translate specific socket kernel structure to generic Address
53 virtual Address TranslateAddressSpecificToGeneric(sockaddr *, socklen_t) const;
56 * Get specific socket kernel structure size
58 virtual socklen_t GetSpecificAddressSize() const;
61 * Alloc specific implementation of socket from descriptor
63 virtual UnixSocket *AllocAcceptedSpecificSocket() const;
66 * Alloc specific implementation of socket descriptor
68 virtual int AllocSpecificDescriptor() const;
73 virtual void Bind(const Address &address);
79 #endif // DPL_GENERIC_SOCKET_H