… | |
… | |
87 | Listen => 50, |
87 | Listen => 50, |
88 | or die "unable to start server"; |
88 | or die "unable to start server"; |
89 | |
89 | |
90 | listen_on $http_port; |
90 | listen_on $http_port; |
91 | |
91 | |
|
|
92 | if ($SERVER_PORT2) { |
92 | my $http_port = new Coro::Socket |
93 | my $http_port = new Coro::Socket |
93 | LocalAddr => $SERVER_HOST, |
94 | LocalAddr => $SERVER_HOST, |
94 | LocalPort => $SERVER_PORT2, |
95 | LocalPort => $SERVER_PORT2, |
95 | ReuseAddr => 1, |
96 | ReuseAddr => 1, |
96 | Listen => 50, |
97 | Listen => 50, |
97 | or die "unable to start server"; |
98 | or die "unable to start server"; |
98 | |
99 | |
99 | listen_on $http_port; |
100 | listen_on $http_port; |
|
|
101 | } |
100 | |
102 | |
101 | our $NOW; |
103 | our $NOW; |
102 | our $HTTP_NOW; |
104 | our $HTTP_NOW; |
103 | |
105 | |
104 | Event->timer(interval => 1, hard => 1, cb => sub { |
106 | Event->timer(interval => 1, hard => 1, cb => sub { |