fix echoing (?)
[spider.git] / perl / Msg.pm
index 4bc31faddfcf92546427549c4a0f81d5e39f45c8..52f0efd477aefbee6d622f0c708d92875b31eeca 100644 (file)
@@ -61,6 +61,13 @@ sub set_error
        $conn->{eproc} = $callback;
 }
 
+sub set_eof
+{
+       my $conn = shift;
+       my $callback = shift;
+       $conn->{sock}->on_eof(sub {$callback});
+}
+
 sub set_rproc
 {
        my $conn = shift;
@@ -459,6 +466,12 @@ sub set_event_handler
        dbg("Msg::set_event_handler called from ${pkg}::${fn} line $line doing $s");
 }
 
+sub echo
+{
+       my $conn = shift;
+       return defined $_[0] ? $conn->{echo} = $_[0] : $_[0];
+}
+
 sub DESTROY
 {
        my $conn = shift;