Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

12. Working with Streams > Working with Sockets

Working with Sockets

image with no caption

Now that we’ve used streams to communicate with the REPL and with files, let’s see how we can use them to communicate with another computer.

If you want to write a program that can communicate with another computer elsewhere on a standard network (almost all networks nowadays use the TCP/IP protocol), you’ll first need to create a socket. A socket is a mechanism for routing data over a computer network between programs running on different computers on that network.

Unfortunately, sockets didn’t make it into the ANSI Common Lisp standard, which means there’s no standard way of interacting with sockets at this time. However, every version of Common Lisp supports sockets, even if it doesn’t follow any standard. Since we’ve been using CLISP as our Lisp of choice in this book, we’ll consider only CLISP’s socket commands.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint