i don't remember where get these words that:"it is easy to reuse others code with c++,but hard to ensure the reusiblility for your own code with c++",that is nothing but trusim,if you want to ensure the reusablity,you should at least have a throught view of the problem space and design model for the problem related,which is abstractly hard,aside from experience,art of design takes a big role.
if you want to 'touch ' this kind of art,here i recommend you to try ACE,which is really charming
so,here is the point:
the author refracted the socket and encapulated socket api based the role it takes during one communication,in fact ,if you have erver ananlysed some link control protocol,all these will not be problem for you:
(1)negative acceptor,which is a socket factory
(2)passive connector,the concept itself is easy to pick up,but hard to implement.here the author did it based on generic feature supported by c++
(3)stream,this part is just to respond to receiving and sending of data,nothing to do with the establishing of connection or some other parts
if you want to 'touch ' this kind of art,here i recommend you to try ACE,which is really charming
so,here is the point:
the author refracted the socket and encapulated socket api based the role it takes during one communication,in fact ,if you have erver ananlysed some link control protocol,all these will not be problem for you:
(1)negative acceptor,which is a socket factory
(2)passive connector,the concept itself is easy to pick up,but hard to implement.here the author did it based on generic feature supported by c++
(3)stream,this part is just to respond to receiving and sending of data,nothing to do with the establishing of connection or some other parts