Dali 3D User Interface Engine
socket-impl.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_ADAPTOR_SOCKET_IMPL_H__
2 #define __DALI_INTERNAL_ADAPTOR_SOCKET_IMPL_H__
3 
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20 
22 
23 namespace Dali
24 {
25 
26 namespace Internal
27 {
28 
29 namespace Adaptor
30 {
31 
37 class Socket : public SocketInterface
38 {
39 public:
40 
46  Socket( Protocol protocol , int fileDescriptor = -1 );
47 
51  virtual bool SocketIsOpen() const;
52 
56  virtual bool CloseSocket();
57 
61  virtual bool Bind( uint16_t port ) ;
62 
66  virtual bool Listen( int blacklog);
67 
71  virtual SocketInterface* Accept() const ;
72 
76  virtual SelectReturn Select( );
77 
81  virtual void ExitSelect();
82 
86  virtual bool Read( void* buffer, unsigned int bufferSizeInBytes, unsigned int& bytesRead );
87 
91  virtual bool Write( const void* buffer, unsigned int bufferLength );
92 
96  virtual bool ReuseAddress( bool reUse );
97 
102  virtual bool SetBufferSize( SocketInterface::BufferType type, unsigned int bufferSizeInBytes );
103 
107  virtual ~Socket();
108 
109 private:
110 
111 
115  bool CreateQuitPipe();
116 
120  void DeleteQuitPipe();
121 
123  int mQuitPipe[2];
124  bool mBound:1;
125  bool mListening:1;
127  bool mBlocked:1;
128 };
129 
130 
131 
132 } // Adaptor
133 
134 } // Internal
135 
136 } // Dali
137 
138 #endif // __DALI_INTERNAL_ADAPTOR_SOCKET_IMPL_H__
Dali Docs Home
Read more about Dali