libraries/iosrv/server/readwrite.cpp
changeset 14 4ab8c027df23
parent 0 7f656887cf89
child 83 706c7a69e448
equal deleted inserted replaced
2:68b921ce1944 14:4ab8c027df23
   360 	if (iEndPoint)
   360 	if (iEndPoint)
   361 		{
   361 		{
   362 		ReadEndPoint()->IorepDetach(*this);
   362 		ReadEndPoint()->IorepDetach(*this);
   363 		}
   363 		}
   364 
   364 
   365 	aEndPoint.IorepAttachL(*this, aMode);
       
   366 	iEndPoint = &aEndPoint;
   365 	iEndPoint = &aEndPoint;
       
   366 	TRAPD(err, aEndPoint.IorepAttachL(*this, aMode));
       
   367 	if (err)
       
   368 		{
       
   369 		iEndPoint = NULL;
       
   370 		User::Leave(err);
       
   371 		}
   367 	}
   372 	}
   368 
   373 
   369 void CIoReadObject::SetReadMode(RIoReadHandle::TReadMode aMode)
   374 void CIoReadObject::SetReadMode(RIoReadHandle::TReadMode aMode)
   370 	{
   375 	{
   371 	iReadMode = aMode;
   376 	iReadMode = aMode;
   952 	if (iEndPoint)
   957 	if (iEndPoint)
   953 		{
   958 		{
   954 		WriteEndPoint()->IowepDetach(*this);
   959 		WriteEndPoint()->IowepDetach(*this);
   955 		}
   960 		}
   956 
   961 
   957 	aEndPoint.IowepAttachL(*this);
       
   958 	iEndPoint = &aEndPoint;
   962 	iEndPoint = &aEndPoint;
       
   963 	TRAPD(err, aEndPoint.IowepAttachL(*this));
       
   964 	if (err)
       
   965 		{
       
   966 		iEndPoint = NULL;
       
   967 		User::Leave(err);
       
   968 		}
   959 	}
   969 	}
   960 
   970 
   961 void CIoWriteObject::WriteL(const RMsg& aMessage)
   971 void CIoWriteObject::WriteL(const RMsg& aMessage)
   962 	{
   972 	{
   963 	__ASSERT_RETURN(iEndPoint, PanicClient(aMessage, EPanicWriteWhenNotAttached));
   973 	__ASSERT_RETURN(iEndPoint, PanicClient(aMessage, EPanicWriteWhenNotAttached));