You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: syslog_server.rs
    path of file: ./repos/openobserve/src/job
    
    the code of the file until where you have to start completion: // Copyright 2023 Zinc Labs Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms
    
pub async fn run(start_srv: bool, is_init: bool) -> Result<(), anyhow::Error> {
    let server_running = *SYSLOG_ENABLED.read();
    let bind_addr = "0.0.0.0";
    let tcp_addr: SocketAddr = format!("{bind_addr}:{}", CONFIG.tcp.tcp_port).parse()?;
    let udp_addr: SocketAddr = format!("{bind_addr}:{}", CONFIG.tcp.udp_port).parse()?;
    if (!server_running || is_init) && start_srv {
        log::info!("Starting TCP UDP server");
        let tcp_listener: TcpListener = TcpListener::bind(tcp_addr).await?;
        let udp_socket = UdpSocket::bind(udp_addr).await?;
        tokio::task::spawn(async move {
            _ = tcp_server(tcp_listener).await;
        });
        tokio::task::spawn(async move {
            _ = udp_server(udp_socket).await;
        });
        toggle_syslog_setting(start_srv).await.unwrap();
    } else if server_running && !start_srv {
        // stop running server
        let sender = BROADCASTER.read().await;
        let _ = sender.send(start_srv);

        let socket = UdpSocket::bind("0.0.0.0:34254").await?;
        socket.send_to(STOP_SRV.as_bytes(), udp_addr).await?;
        let mut stream = TcpStream::connect(tcp_addr)?;
        stream.write_all(STOP_SRV.as_bytes())?;

        drop(socket);
        drop(stream);
        toggle_syslog_setting(start_srv).await.unwrap();
    }

    Ok(())
}