- my $sock = $server_conn->{sock}->accept();
- my $conn = $server_conn->new($server_conn->{rproc});
- $conn->{sock} = $sock;
-
- my ($rproc, $eproc) = &{$server_conn->{rproc}} ($conn, $conn->{peerhost} = $sock->peerhost(), $conn->{peerport} = $sock->peerport());
- if ($eproc) {
- $conn->{eproc} = $eproc;
- Msg::set_event_handler ($sock, "error" => $eproc);
- }
- if ($rproc) {
- $conn->{rproc} = $rproc;
- my $callback = sub {$conn->_rcv};
- Msg::set_event_handler ($sock, "read" => $callback);
- # send login prompt
- $conn->{state} = 'WL';
-# $conn->send_raw("\xff\xfe\x01\xff\xfc\x01\ff\fd\x22");
-# $conn->send_raw("\xff\xfa\x22\x01\x01\xff\xf0");
-# $conn->send_raw("\xFF\xFC\x01");
- $conn->_send_file("$main::data/issue");
- $conn->send_raw("login: ");
- $conn->_dotimeout(60);
- } else {
- $conn->disconnect();
- }
+ my $client = shift;
+ my $conn = $server_conn->SUPER::new_client($client);
+ # send login prompt
+ $conn->{state} = 'WL';
+ $conn->_send_file(localdata("issue"));
+ $conn->send_raw("login: ");
+ $conn->_dotimeout(60);
+ $conn->{echo} = 1;