Skip to Content

example code: socket server and client using select()

I spent the last hour re-familiarizing myself with Unix sockets via man-pages and HOWTOs. I have written client/server socket apps a dozen times before but because of iterative development I no longer had a simple example lying around.

To save myself this trouble in the future I created a little socket client and server for future reference. This app allows you to have a Twitter style conversation (140 char limit) with everyone on your system who has permissions to the Unix socket! Perhaps the Unix shell is the next micro-blogging platform. ;)

One Comment

  1. Posted 8/30/2008 at 9:23 am | Permalink

    Quick note: it is technically possible for send() to not send all of “len”, and the return value should be tested more closely to send any left-over bytes.

2 Trackbacks

  1. [...] loveress on Sun 28-9-2008 Why People Believe in Religion Saved by HungryMikey on Sun 28-9-2008 example code: socket server and client using select() Saved by SierraLorna on Sun 28-9-2008 Build Median Aggregate Function in SQL Saved by HatakeAyumi [...]

  2. By Bookmarks about Code on 12/10/2008 at 10:02 pm

    [...] - bookmarked by 4 members originally found by kangas on 2008-11-02 example code: socket server and client using select() http://ifup.org/2008/08/30/example-code-socket-server-and-client-using-select - bookmarked by 5 [...]

Post a Comment

Your email is never published nor shared.