mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add comments for main
This commit is contained in:
parent
b38df9cd1a
commit
0a016e58bf
2 changed files with 10 additions and 4 deletions
|
@ -205,7 +205,7 @@ int SrsServer::initialize()
|
|||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
// for the main objects(server, config, log),
|
||||
// for the main objects(server, config, log, context),
|
||||
// never subscribe handler in constructor,
|
||||
// instead, subscribe handler in initialize method.
|
||||
srs_assert(_srs_config);
|
||||
|
|
|
@ -42,6 +42,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <srs_app_log.hpp>
|
||||
#include <srs_app_utility.hpp>
|
||||
|
||||
// pre-declare
|
||||
int run();
|
||||
int run_master();
|
||||
|
||||
// for the main objects(server, config, log, context),
|
||||
// never subscribe handler in constructor,
|
||||
// instead, subscribe handler in initialize method.
|
||||
// kernel module.
|
||||
ISrsLog* _srs_log = new SrsFastLog();
|
||||
ISrsThreadContext* _srs_context = new SrsThreadContext();
|
||||
|
@ -49,15 +56,14 @@ ISrsThreadContext* _srs_context = new SrsThreadContext();
|
|||
SrsConfig* _srs_config = new SrsConfig();
|
||||
SrsServer* _srs_server = new SrsServer();
|
||||
|
||||
// signal handler
|
||||
void handler(int signo)
|
||||
{
|
||||
srs_trace("get a signal, signo=%d", signo);
|
||||
_srs_server->on_signal(signo);
|
||||
}
|
||||
|
||||
int run();
|
||||
int run_master();
|
||||
|
||||
// main entrance.
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue