C equivalent to Boost Asio?

Discussion in 'Mac Programming' started by Cromulent, Nov 6, 2010.

  1. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #1
    Does anyone know if there is a C equivalent to Boost Asio at all? By that I mean a cross platform library that allows async network IO using the best method for each platform (kqueue on Mac and FreeBSD and epoll on Linux etc).

    I haven't been able to find anything from Googling, does anyone have any suggestions at all?
     
  2. macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
  3. thread starter macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #3
    Alas I have already looked at that but the real time extensions to the POSIX standard are for files only. At least that is what the man page for aio_write() says.
     
  4. macrumors regular

    Joined:
    Jan 19, 2006
  5. macrumors 68040

    Joined:
    Feb 2, 2008
    #5
    Wouldn't any type of file descriptor work, such as sockets and so on?
     
  6. thread starter macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #6
    Oops sorry for the late reply. I completely missed your response.

    I took the man page at face value to be honest. Anyway I spent a little more time investigating this issue and basically decided that it came down to writing the entire server process in C (which is not a task I particularly relish) or using a language like Erlang which seems to be much better at handling such systems.

    Another plus side to using Erlang is that it seems to be the first functional language I have really 'got'. I'm really enjoying the change from C / Java / C++ / Python. It's a bit of an eye opening experience. I might jump into Prolog and (finally, I've been meaning to do it for about 2 years now) sit down and learn Haskell next :).
     
  7. macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    #7
    Why would you want to use a "C equivalent" of this library? If it is available on the Mac, then just use it.
     
  8. thread starter macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #8
    Because avoiding C++ is the name of the game. If it truly were the only option available to me then yeah I'd bite the bullet but it is not.
     

Share This Page