home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 33,282 of 33,346   
   =?ISO-8859-1?Q?=D6=F6_Tiib?= to Seungbeom Kim   
   Re: Thin, fast C++11 wrapper for BSD soc   
   17 Feb 14 12:39:42   
   
   From: ootiib@hot.ee   
      
   On Monday, 17 February 2014 07:39:59 UTC+2, Seungbeom Kim  wrote:   
   > On 2014-02-14 23:17, Öö Tiib wrote:   
   > >   
   > > Code that uses Berkeley sockets API directly either does not work   
   > > (too naive) or is quite big. One can write very light wrapper   
   > > indeed but that forwards all the issues, adds no convenience and   
   > > so ... is just bloat.   
     > Why would it just "not work" or "add no convenience"?   
      
   You even confirm it below with your example. We do not use gotos in   
   simple code. So for to add convenience the wrapper has to take   
   responsibilities to deal with some of the complexities. Then however   
   it is not "thin" anymore.   
      
   > I can imagine that a very thin wrapper around the Berkeley sockets   
   > API (e.g. a class that encapsulates a socket descriptor) can at   
   > least let us write RAII-style code and help a lot with cleanup when   
   > an error happens.  (I still remember having to resort to multiple   
   > goto's just for cleanup when writing a networking program in   
   > C... not very pleasant!)   
      
   That (and lot more) is done in existing libraries like Boost.Asio. I   
   was only explaining that those are not that thin and simple wrappers   
   like OP asked for.   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca