This lab requires the Pretty Big language, which is under PLT in the language list.
Choose a representations for songs, where each song has a title, artist, and length in seconds. Given a data definition for song, the definition of list-of-song is the usual one.
Pair up. Each pair should agree on an S-expression encoding of song lists. Implement songs->sexp : list-of-song -> sexp.
Designate one member of each pair as the server and one as the client.
The server must define a listener: (define l (tcp-listen 4000))
The client should then connect to the server: (define-values (i o) (tcp-connect "server-name" 4000))
Finally, the server should accept the connection: (define-values (i o) (tcp-accept l))
Server and client each write their song-list S-expressions to the TCP output port using write, and each read a song-list S-expression from the TCP input port using read. In other words, the pair trades song lists.
Implement sexp->songs : sexp -> song-list to convert a received song list S-expression.
Last update: Wednesday, October 29th, 2003mflatt@cs.utah.edu