350 |
|
|
351 |
|
|
352 |
if ( $port ) { |
if ( $port ) { |
353 |
|
|
354 |
|
my $pid_path = "/tmp/sack.$port.pid"; |
355 |
|
if ( -e $pid_path ) { |
356 |
|
my $pid = read_file $pid_path; |
357 |
|
kill 9, $pid && warn "[$port] kill old $pid"; |
358 |
|
} |
359 |
|
write_file $pid_path, $$; |
360 |
|
|
361 |
|
|
362 |
my $sock = IO::Socket::INET->new( |
my $sock = IO::Socket::INET->new( |
363 |
Listen => SOMAXCONN, |
Listen => SOMAXCONN, |
364 |
LocalAddr => '127.0.0.1', |
LocalAddr => '127.0.0.1', |
411 |
warn "[$port] UNKNOWN $header[0]"; |
warn "[$port] UNKNOWN $header[0]"; |
412 |
} |
} |
413 |
|
|
414 |
|
$client->close; |
415 |
|
|
416 |
} |
} |
417 |
} |
} |
418 |
|
|