Create the first assignment: 'timeserver'
This commit is contained in:
parent
bc6a19ff33
commit
a54d88dc70
6 changed files with 92 additions and 0 deletions
33
timeserver/timeserver.c
Normal file
33
timeserver/timeserver.c
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// header files
|
||||
#include "timeserver.h"
|
||||
|
||||
// constants
|
||||
// timeserver port is 8888
|
||||
#define TIMEPORT "8888"
|
||||
|
||||
// prototypes
|
||||
|
||||
// main function
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
// initialize program (variables and structs)
|
||||
// define a UDP socket
|
||||
// bind the UDP socket to port 8888 / TIMEPORT
|
||||
// while loop to see if the "time\r\n" has been received (recv call?)
|
||||
// if "time\r\n" is received, then send() back the linux epoch.
|
||||
// profit???
|
||||
return 0;
|
||||
}
|
||||
|
||||
// function definitions
|
||||
|
||||
/*
|
||||
Name: ???
|
||||
Process: ???
|
||||
Function Input/Parameters: ???
|
||||
Function Output/Parameters: ???
|
||||
Function Output/Returned: ???
|
||||
Device Input/Device: ???
|
||||
Device Output/Device: ???
|
||||
Dependencies: ???
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue