//-------------------------------------------------------------------------------------
void EventDispatcher::attachTo(EventDispatcher & parentDispatcher)
{
	KBE_ASSERT(pCouplingToParent_ == NULL);
	pCouplingToParent_ = new DispatcherCoupling(parentDispatcher, *this);

	int fd = pPoller_->getFileDescriptor();

	if (fd != -1)
	{
		parentDispatcher.registerFileDescriptor(fd, pPoller_);
		parentDispatcher.registerWriteFileDescriptor(fd, pPoller_);
	}
}