… | |
… | |
1087 | If called in non-void context, then this function returns a guard object |
1087 | If called in non-void context, then this function returns a guard object |
1088 | whose lifetime it tied to the TCP server: If the object gets destroyed, |
1088 | whose lifetime it tied to the TCP server: If the object gets destroyed, |
1089 | the server will be stopped (but existing accepted connections will |
1089 | the server will be stopped (but existing accepted connections will |
1090 | not be affected). |
1090 | not be affected). |
1091 | |
1091 | |
|
|
1092 | Regardless, when the function returns to the caller, the socket is bound |
|
|
1093 | and in listening state. |
|
|
1094 | |
1092 | If you need more control over the listening socket, you can provide a |
1095 | If you need more control over the listening socket, you can provide a |
1093 | C<< $prepare_cb->($fh, $host, $port) >>, which is called just before the |
1096 | C<< $prepare_cb->($fh, $host, $port) >>, which is called just before the |
1094 | C<listen ()> call, with the listen file handle as first argument, and IP |
1097 | C<listen ()> call, with the listen file handle as first argument, and IP |
1095 | address and port number of the local socket endpoint as second and third |
1098 | address and port number of the local socket endpoint as second and third |
1096 | arguments. |
1099 | arguments. |