[complement-svn] SF.net SVN: complement: [1885] branches/complement-sockios/explore
Status: Pre-Alpha
Brought to you by:
complement
From: <oke...@us...> - 2008-06-04 13:54:00
|
Revision: 1885 http://complement.svn.sourceforge.net/complement/?rev=1885&view=rev Author: okechina Date: 2008-06-04 06:53:54 -0700 (Wed, 04 Jun 2008) Log Message: ----------- Modified Paths: -------------- branches/complement-sockios/explore/include/sockios/sp.cc branches/complement-sockios/explore/include/sockios/sp.h branches/complement-sockios/explore/lib/sockios/ut/sockios2_test.cc Modified: branches/complement-sockios/explore/include/sockios/sp.cc =================================================================== --- branches/complement-sockios/explore/include/sockios/sp.cc 2008-06-03 13:19:42 UTC (rev 1884) +++ branches/complement-sockios/explore/include/sockios/sp.cc 2008-06-04 13:53:54 UTC (rev 1885) @@ -502,7 +502,7 @@ epoll_event ev_add; ev_add.events = EPOLLIN | EPOLLRDHUP | EPOLLERR | EPOLLHUP | EPOLLET | EPOLLONESHOT; ev_add.data.fd = fd; -//undeclared s with some flags +//undeclared s // fd_info new_info = { fd_info::owner, s, info.p }; fd_info new_info = { fd_info::owner, 0, info.p }; descr[fd] = new_info; @@ -734,7 +734,7 @@ for ( typename fd_container_type::iterator ifd = descr.begin(); ifd != descr.end(); ) { if ( (ifd->second.flags & fd_info::owner) && (ifd->second.p == &p) ) { std::cerr << __FILE__ << ":" << __LINE__ << " " << (void*)&p << " " << (void*)ifd->second.s.s << std::endl; - p( *ifd->second.s.s, typename socks_processor_t::adopt_close_t() ); + p( /* *ifd->second.s.s */ /* *ifd->second.s.s.rdbuf()->fd() */, typename socks_processor_t::adopt_close_t() ); std::cerr << __FILE__ << ":" << __LINE__ << " " << (void*)&p << " " << (void*)ifd->second.s.s << std::endl; delete ifd->second.s.s; if ( epoll_ctl( efd, EPOLL_CTL_DEL, ifd->first, 0 ) < 0 ) { Modified: branches/complement-sockios/explore/include/sockios/sp.h =================================================================== --- branches/complement-sockios/explore/include/sockios/sp.h 2008-06-03 13:19:42 UTC (rev 1884) +++ branches/complement-sockios/explore/include/sockios/sp.h 2008-06-04 13:53:54 UTC (rev 1885) @@ -110,13 +110,13 @@ protected: void setoptions_unsafe( sock_base2::so_t optname, bool on_off = true, int __v = 0 ); -/* sockstream_t* create_stream( int fd ) + sockstream_t* create_stream( int fd ) { - typename base_t::sockstream_t* s = new typename base_t::sockstream_t(); - s->rdbuf()->_open_sockmgr( fd, addr ); + sockstream_t* s = new sockstream_t(); + // s->rdbuf()->_open_sockmgr( fd, addr ); return s; } -*/ + public: bool is_open() const { std::tr2::lock_guard<std::tr2::mutex> lk(_fd_lck); return basic_socket_t::is_open_unsafe(); } @@ -193,7 +193,9 @@ // { // std::tr2::lock_guard<std::tr2::mutex> lk( wklock ); for ( typename worker_pool_t::iterator i = worker_pool.begin(); i != worker_pool.end(); ++i ) { - delete i->second; + // delete i->second; + delete i->second.s; + delete i->second.c; } worker_pool.clear(); // } Modified: branches/complement-sockios/explore/lib/sockios/ut/sockios2_test.cc =================================================================== --- branches/complement-sockios/explore/lib/sockios/ut/sockios2_test.cc 2008-06-03 13:19:42 UTC (rev 1884) +++ branches/complement-sockios/explore/lib/sockios/ut/sockios2_test.cc 2008-06-04 13:53:54 UTC (rev 1885) @@ -46,11 +46,11 @@ { /* cerr << "In destructor\n"; */ } protected: - virtual void operator ()( sockstream_t& s, const adopt_new_t& ) + virtual void operator ()( int, const adopt_new_t& ) { lock_guard<mutex> lk(lock); b.wait(); ++n_cnt; } - virtual void operator ()( sockstream_t& s, const adopt_close_t& ) + virtual void operator ()( int, const adopt_close_t& ) { lock_guard<mutex> lk(lock); b.wait(); ++c_cnt; } - virtual void operator ()( sockstream_t& s, const adopt_data_t& ) + virtual void operator ()( int, const adopt_data_t& ) { lock_guard<mutex> lk(lock); ++d_cnt; } public: @@ -80,17 +80,17 @@ { } protected: - virtual void operator ()( sockstream_t& s, const adopt_new_t& ) + virtual void operator ()( int, const adopt_new_t& ) { lock_guard<mutex> lk(lock); b.wait(); ++n_cnt; } - virtual void operator ()( sockstream_t& s, const adopt_close_t& ) + virtual void operator ()( int, const adopt_close_t& ) { lock_guard<mutex> lk(lock); b.wait(); ++c_cnt; } - virtual void operator ()( sockstream_t& s, const adopt_data_t& ) + virtual void operator ()( int, const adopt_data_t& ) { lock_guard<mutex> lk(lock); b.wait(); ++d_cnt; string str; - getline( s, str ); + // getline( s, str ); // map fd -> s EXAM_CHECK_ASYNC( str == "Hello" ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |