



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Professor: Hollingsworth; Class: INTRO TO LOW-LEVEL PROG; Subject: Computer Science; University: University of Maryland; Term: Unknown 1989;
Typology: Study notes
1 / 7
This page cannot be seen from the preview
Don't miss anything!




CMSC 212 – S07 (lect 20)^1
CMSC 212 – S07 (lect 20)^2
Two Goals
CMSC 212 – S07 (lect 20)^3
CMSC 212 – S07 (lect 20)^4
CMSC 212 – S07 (lect 20)^7
CMSC 212 – S07 (lect 20)^8
CMSC 212 – S07 (lect 20)^9
int main() { int ret, myServerFD, maxFD = 0; FD_SET set; myServerFD = connectToServer(); while (1) { FD_ZERO(&set); FD_SET(0, &set); FD_SET(myServerFD, &set); if (myServerFD > maxFD) maxFd = myServerFD; ret = select(maxFd+1, &set, NULL, NULL, NULL); if (ret) { if (FD_ISSET(0, &set)) { /* read from standard input / } if (FD_ISSET(myServerFD, &set)) { / read from net */ } } } }
CMSC 212 – S07 (lect 20)^10
CMSC 212 – S07 (lect 20)^13
CMSC 212 – S07 (lect 20)^14