美文网首页
C代写TCP/IP监听程序 CS312 TCP/IP Watch

C代写TCP/IP监听程序 CS312 TCP/IP Watch

作者: dizenti | 来源:发表于2019-04-28 10:07 被阅读0次

& Assignment InformationThis program shall be written in C, compiled with the following options:-Wall -Wextra-std=c99, and display no errors and no warnings. Do not submit executable files (only C source files).In this assignment, you are to implement a multithreaded TCP/IP watchdog daemon - a program that continuously monitors a collection of TCP/IP hosts (also known as Web sites) for availability. The program shall:Start itself in the daemon mode (see Beginner’s Guide to Creating a Daemon). This includes opening and closing the log, writing a log message “TCP/IP Watchdog started” (less the quotes) at the level LOG_NOTICE, forking, setting umaskand session id, changing the working directory to /, and closing the standard I/O files. Any error messages shall be logged as LOG_ERR.Write the process ID into the file /tmp/watchdog.pid.Set a signal handler for SIG_USR1 (other signal handler may be set to handle other types of signals.) Upon receiving SIG_USR1, the program shall write a log message “TCP/IP Watchdog stopped” (less the quotes) at the level LOG_NOTICE and successfully terminate.Open the existing file /tmp/watchdog.datand reading a list of hosts to watch. Each line of the file shall have one valid host name, possibly precededand/or followed by one or more white spaces. Any line that stars with the ‘#’ character shall be ignored. Any line that consists only of white spaces shall be ignored.Start a new thread for each host name. The thread shall create a TCP/IP socket and connect to the host every WD_INTERVAL milliseconds (where the value of WD_INTERVAL shall be #defined in the file “watchdog.h”). If the connection times out after WD_TIMEOUT milliseconds (where the value of WD_TIMEOUT shall be #defined in the file “watchdog.h”), the program shall log the following message at the filevel LOG_WARNING: “Host %s is not responding”, filess the quotes, where %s is the name of the host. If the connection is successful, the program shall disconnect and repeat the attempt after WD_INTERVAL milliseconds. You will probably need functions setitimer()and sigaction() to set and handle the timeout.For extra credit, your program shall set a signal handler for SIG_USR2. Upon receiving SIG_USR2, the program shall stop all running threads, reread the file/tmp/watchdog.dat, and start new threads for the new names of the hosts in the file.Update: I attached file connect.c that attempts to connect to a remote computer through port 80 (default HTTP port for the Web browser). You can use this file as a reference for your project. Also, note that the minor change in the requirements (highlighted).本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp

相关文章

  • C代写TCP/IP监听程序 CS312 TCP/IP Watch

    & Assignment InformationThis program shall be written i...

  • JNCIE-SEC补充学习资料

    TCP/IP [《TCP/IP详解》](https://c.duomai.com/track.php?* site...

  • 2019-04-15命令重装tcp/ip

    重新安装TCP/IP以使TCP/IP堆栈恢复为原始状态。可以使用NetShell实用程序重置TCP/IP堆栈,使其...

  • C1 了解Web及网络基础

    KeyWords: 诞生,网络基础TCP/IP,TCP/IP协议族,TCP/IP的分层管理,TCP/IP通信传输流...

  • TCP协议

    TCP/IP协议分层详解TCP/IP协议详解通俗易懂网络协议(TCP/IP概述)什么是TCP/IP协议?

  • TCP HTTPS专题

    TCP HTTPS专题 TCP协议 TCP/IP协议分层 TCP/IP 协议族里重要的一点就是分层。 TCP/IP...

  • 《图解HTTP》

    网络基础TCP/IPTCP/IP协议族说法一:TCP/IP是指TCP和IP两种协议说法二:TCP/IP是在IP协议...

  • TCP 和 UDP 的区别

    写在开头: TCP UDP 都属于 TCP/IP 协议簇 , TCP/IP 协议包括了TCP,UDP,IP,FTP...

  • 图解HTTP 学习笔记一

    网络基础:TCP/IP TCP/IP 首先,借用原书的图TCP/IP协议族 按照书中的定义,所谓TCP/IP就是与...

  • (二)TCP/IP四层模型

    1、基本介绍 TCP/IP协议,也称TCP/IP协议族或TCP/IP协议栈,其中: TCP:Transmissio...

网友评论

      本文标题:C代写TCP/IP监听程序 CS312 TCP/IP Watch

      本文链接:https://www.haomeiwen.com/subject/kagrnqtx.html