Exercise 7
Week 48
Exercises 7 are in computer classes:
Group 1: on Monday Nov. 26 at 16-18 in T/B178
Group 2: on Friday Nov. 30 at 8-10 in T/B178
man threads
and add comment lines to the following program for explaining the
program code. Compile the program in cs-computer and execute it. Think
what benefits threads can provide.
http://cs.joensuu.fi/pages/mhk/harjoitukset/kj/h7/pthread_example.c
socket_server
works as a server by listening to a specified port. Client
socket_client
will send a request for server, and server
accepts a connection from the client to complete the connection.
Explain the usage of the sockets in the following programs. Compile them and execute in cs-computer. Execute first the server and then execute client, in separate sessions. You can try also a connection from other machine connected to internet.
http://cs.joensuu.fi/pages/mhk/harjoitukset/kj/h7/socket_server.c
http://cs.joensuu.fi/pages/mhk/harjoitukset/kj/h7/socket_client.c