// Binds and runs the application on the given config port.
Binds and runs the application on the given config port.
// Binds and runs the application on the given config port .
func (m *Milo) Run() {
	port := m.port
	if m.portIncrement {
		for {
			log.Println("Connection:", m.getConnectionString())
			srv := m.getHTTPServer()
			err := srv.ListenAndServe()
			if err != nil {
				if strings.Contains(err.Error(), BIND_ERR) {
					port++
					time.Sleep(100 * time.Millisecond)
				} else {
					m.logger.LogError(err)
					os.Exit(2)
				}
			}
		}
	} else {
		log.Println("Connection:", m.getConnectionString())
		srv := m.getHTTPServer()
		if err := srv.ListenAndServe(); err != nil {
			m.logger.LogError(err)
		}
	}
}
func ( m * Milo ) Run ( ) { port := m . port if m . portIncrement { for { log . Println ( " " , m . getConnectionString ( ) ) srv := m . getHTTPServer ( ) err := srv . ListenAndServe ( ) if err != nil { if strings . Contains ( err . Error ( ) , BIND_ERR ) { port ++ time . Sleep ( 100 * time . Millisecond ) } else { m . logger . LogError ( err ) os . Exit ( 2 ) } } } } else { log . Println ( " " , m . getConnectionString ( ) ) srv := m . getHTTPServer ( ) if err := srv . ListenAndServe ( ) ; err != nil { m . logger . LogError ( err ) } } }
Binds and runs the application on the given config port.
Binds and runs the application on the given config port .