From: Jeff Moore Date: 2008-11-11T05:35:02+09:00 Subject: Re: Socket Progamming - Beginner questions > How would you set up a socket to > monitor a directory or database or is my understanding of the matter > off? > Sockets are just a conduit for data. You can use their blocking capability (via select, etc) to control some portion of the interaction between the client and server (or whatever relationship you deem appropriate between the end points). Regardless, you still require an active process/thread to 'put' the data into one end of the socket and another to active process/thread to 'get' it at the other end. It's much easier if you maintain the separation of client/network/server activities in your mind and in the code. Another consideration is that this a glorious intersection of things (both threads and sockets) that are similar across multiple platforms but only similar. Each platform has it's own features (quirks). The source code for webrick and the net library in lib provide plenty of examples of how threads and sockets interact (or not) in an internet application. It's one of the beauties of Ruby. You get the code. -- Posted via http://www.ruby-forum.com/.