|
Urbi SDK Remote for C++
2.7.5
|
00001 /* 00002 * Copyright (C) 2010, Gostai S.A.S. 00003 * 00004 * This software is provided "as is" without warranty of any kind, 00005 * either expressed or implied, including but not limited to the 00006 * implied warranties of fitness for a particular purpose. 00007 * 00008 * See the LICENSE file for more information. 00009 */ 00010 00011 #ifndef URBI_SOCKET_HH 00012 # define URBI_SOCKET_HH 00013 00014 #include <libport/asio.hh> 00015 #include <urbi/uobject.hh> 00016 00017 namespace urbi 00018 { 00022 class UObjectSocket: public libport::Socket 00023 { 00024 public: 00025 UObjectSocket(boost::asio::io_service& io = 00026 getCurrentContext()->getIoService()) 00027 : libport::Socket(io) 00028 { 00029 } 00030 ~UObjectSocket() 00031 { 00032 close(); 00033 wasDestroyed(); 00034 while (!checkDestructionPermission()) 00035 getCurrentContext()->yield_for(1000); 00036 } 00037 }; 00038 } 00039 #endif