【问题标题】:C++ get service network status linuxC++获取服务网络状态linux
【发布时间】:2011-01-24 11:00:52
【问题描述】:

如何在我的 linux 机器上通过 C++ 获取网络服务状态(如终端中的服务网络状态)?

【问题讨论】:

    标签: c++ linux networking service


    【解决方案1】:

    您可能希望使用exec or execv 之类的调用。如果您包含 "unistd.h" ,则它们可用。有关它们如何工作的更多信息,请查看带有 man execlook here 的 exec 手册页:

    系统也可以使用。喜欢 -

    #include <stdlib.h>
    int main() {
    system("ls -l");
    printf("This is a directory list...");
    }
    

    you can use iftop command to find network stats in linux.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-12
      • 1970-01-01
      • 1970-01-01
      • 2017-06-22
      • 2011-09-06
      • 2021-01-01
      • 2017-03-29
      • 1970-01-01
      相关资源
      最近更新 更多