Carrot

 view release on metacpan or  search on metacpan

lib/Carrot/Continuity/Coordination/Episode/Paragraph/TCP_Socket_IO.pm  view on Meta::CPAN

sub set_timeout
# /type method
# /effect ""
# //parameters
#	value
# //returns
{
	if ($_[SPX_VALUE] == 0)
	{
		$_[THIS][ATR_TIMEOUT]->deactivate;
	} else {
		$_[THIS][ATR_TIMEOUT]->adjust($_[SPX_VALUE]);
	}
	return;
}

sub pause_input
# /type method
# /effect ""
# //parameters
#	test_result
# //returns
{
	my ($this, $test_result) = @ARGUMENTS;

	if ($test_result == INOUT_START)
	{
		$this->[ATR_TARGET]->fd_watch_read;
	} elsif ($test_result == INOUT_STOP)
	{
		$this->[ATR_TARGET]->fd_ignore_read;
	}

	return;
}

sub pause_output
# /type method
# /effect ""
# //parameters
#	test_result
# //returns
{
	my ($this, $test_result) = @ARGUMENTS;

	if ($test_result == INOUT_START)
	{
		$this->[ATR_TARGET]->fd_watch_write;
	} elsif ($test_result == INOUT_STOP)
	{
		if ($this->[ATR_INPUT]->is_closed)
		{
			$this->[ATR_OUTPUT]->close;
		}
		$this->[ATR_TARGET]->fd_ignore_write;
	}

	return;
}

sub is_alive
# /type method
# /effect ""
# //parameters
# //returns
#	::Personality::Abstract::Boolean
{
	my ($this) = @ARGUMENTS;

	return(IS_FALSE) unless (defined($this->[ATR_SOCKET]));
	return($this->[ATR_SOCKET]->connected
		and not $this->[ATR_OUTPUT]->is_closed);
}

sub shutdown_input_buffer
# /type method
# /effect ""
# //parameters
# //returns
{
	$_[THIS][ATR_TARGET]->fd_ignore_read;
	$_[THIS][ATR_INPUT]->close;
	return;
}

sub attribute_destruction
# /type method
# /effect "Destructs the attributes of an instance (breaks circular references)"
# //parameters
# //returns
{
	if (defined($_[THIS][ATR_SOCKET]))
	{
		$_[THIS]->evt_time_timeout;
	}
	return;
}

# =--------------------------------------------------------------------------= #

	return(PERL_FILE_LOADED);
}
# //revision_control
#	version 1.1.70
#	branch main
#	maturity alpha
# /license MPL-2.0 (Mozilla Public License v2.0)
# /copyright "(C) 2009-2014 Winfried Trümper <win@carrot-programming.org>"



( run in 0.943 second using v1.01-cache-2.11-cpan-14f38c9f855 )