Home Segments Index Top Previous Next

739: Mainline

Once the server has accepted the connection, then it is time to assign pointer variables that make the socket look like a file from the perspective of functions such as fscanf and fprintf. The client program developed here both reads from and writes to the socket; accordingly, both a read file pointer and a write file pointer have to be created:

to_server = fdopen (socket_number, "w"); 
fm_server = fdopen (socket_number, "r");