[Home]BoostSocket/PlatformSocketConcept

BOOST WIKI | BoostSocket | RecentChanges | Preferences | Page List | Links List

Difference (from prior major revision) (no other diffs)

Changed: 1,289c1,60
http://abes.xchan.com/japan7_4.html
http://abes.xchan.com/japan9_1.html
http://abes.xchan.com/japanes2.html
http://abes.xchan.com/japanes2_1.html
http://abes.xchan.com/japanes2_2.html
http://abes.xchan.com/japanes2_3.html
http://abes.xchan.com/japanes2_4.html
http://abes.xchan.com/japanes2_5.html
http://abes.xchan.com/japanima.html
http://abes.xchan.com/japanis.html
http://abes.xchan.com/japanis_1.html
http://abes.xchan.com/japanis_2.html
http://abes.xchan.com/japanis_3.html
http://abes.xchan.com/japanis_4.html
http://abes.xchan.com/japenese_4.html
http://abes.xchan.com/jenifer.html
http://abes.xchan.com/jenifer_1.html
http://abes.xchan.com/jenifer_2.html
http://abes.xchan.com/jenifer_3.html
http://abes.xchan.com/jenifer_4.html
http://abes.xchan.com/jetsons_2.html
http://abes.xchan.com/jetsons_3.html
http://abes.xchan.com/jetsons_4.html
http://abes.xchan.com/jetsons_5.html
http://abes.xchan.com/jetsons_6.html
http://abes.xchan.com/jewish.html
http://abes.xchan.com/john.html
http://abes.xchan.com/john_1.html
http://abes.xchan.com/john_2.html
http://abes.xchan.com/jokes.html
http://abes.xchan.com/jokes_1.html
http://abes.xchan.com/jokes_5.html
http://abes.xchan.com/junior_2.html
http://abes.xchan.com/just.html
http://abes.xchan.com/just_1.html
http://abes.xchan.com/kamasutr.html
http://abes.xchan.com/kamasutr_1.html
http://abes.xchan.com/kamasutr_2.html
http://abes.xchan.com/kogal_1.html
http://abes.xchan.com/kogal_2.html
http://abes.xchan.com/kogal_3.html
http://abes.xchan.com/koirala.html
http://abes.xchan.com/kong.html
http://abes.xchan.com/kong_4.html
http://abes.xchan.com/lactatin_3.html
http://abes.xchan.com/lactatin_4.html
http://abes.xchan.com/ladies_8.html
http://abes.xchan.com/ladies_9.html
http://abes.xchan.com/lady_4.html
http://abes.xchan.com/lady_5.html
http://abes.xchan.com/latin1.html
http://abes.xchan.com/latin1_1.html
http://abes.xchan.com/latin_7.html
http://abes.xchan.com/latin_8.html
http://abes.xchan.com/latin_9.html
http://abes.xchan.com/latina_2.html
http://abes.xchan.com/lee1.html
http://abes.xchan.com/lee1_1.html
http://abes.xchan.com/lee1_2.html
http://abes.xchan.com/lee_7.html
http://abes.xchan.com/lee_8.html
http://abes.xchan.com/lee_9.html
http://abes.xchan.com/lesb3_1.html
http://abes.xchan.com/lesb3_2.html
http://abes.xchan.com/lesbain.html
http://abes.xchan.com/lesbain_1.html
http://abes.xchan.com/lesbains_2.html
http://abes.xchan.com/lesbian.html
http://abes.xchan.com/lesbians_3.html
http://abes.xchan.com/lesbians_4.html
http://abes.xchan.com/lesbians_5.html
http://abes.xchan.com/lesbians_6.html
http://abes.xchan.com/lesbien_1.html
http://abes.xchan.com/lesbien_2.html
http://abes.xchan.com/lesibian_4.html
http://abes.xchan.com/lesibian_5.html
http://abes.xchan.com/lexus.html
http://abes.xchan.com/lick.html
http://abes.xchan.com/lick_1.html
http://abes.xchan.com/lick_2.html
http://abes.xchan.com/little.html
http://abes.xchan.com/little_1.html
http://abes.xchan.com/little_2.html
http://abes.xchan.com/little_10.html
http://abes.xchan.com/little_11.html
http://abes.xchan.com/little_12.html
http://abes.xchan.com/live1_3.html
http://abes.xchan.com/live1_4.html
http://abes.xchan.com/live1_5.html
http://abes.xchan.com/live1_6.html
http://abes.xchan.com/live1_7.html
http://abes.xchan.com/loita.html
http://abes.xchan.com/loita_1.html
http://abes.xchan.com/loita_2.html
http://abes.xchan.com/loita_3.html
http://abes.xchan.com/loita_4.html
http://abes.xchan.com/loli.html
http://abes.xchan.com/lolita1.html
http://abes.xchan.com/lolita1_1.html
http://abes.xchan.com/lolita1_10.html
http://abes.xchan.com/lolita8.html
http://abes.xchan.com/lolita8_1.html
http://abes.xchan.com/lolita8_2.html
http://abes.xchan.com/lolita9.html
http://abes.xchan.com/lolita_7.html
http://abes.xchan.com/lolita_8.html
http://abes.xchan.com/lolita_9.html
http://abes.xchan.com/lolitas_4.html
http://abes.xchan.com/lolitas_7.html
http://abes.xchan.com/lopez_2.html
http://abes.xchan.com/lopez_3.html
http://abes.xchan.com/lopez_4.html
http://abes.xchan.com/lords_4.html
http://abes.xchan.com/lorita.html
http://abes.xchan.com/lotia.html
http://abes.xchan.com/magazine_9.html
http://abes.xchan.com/magizine.html
http://abes.xchan.com/magna.html
http://abes.xchan.com/magzine.html
http://abes.xchan.com/mai_2.html
http://abes.xchan.com/mai_3.html
http://abes.xchan.com/male1.html
http://abes.xchan.com/male1_1.html
http://abes.xchan.com/male1_10.html
http://abes.xchan.com/male1_11.html
http://abes.xchan.com/male1_12.html
http://abes.xchan.com/male7_3.html
http://abes.xchan.com/male8.html
http://abes.xchan.com/male_9.html
http://abes.xchan.com/males.html
http://abes.xchan.com/males_5.html
http://abes.xchan.com/males_6.html
http://abes.xchan.com/males_7.html
http://abes.xchan.com/man3.html
http://abes.xchan.com/man3_1.html
http://abes.xchan.com/man3_2.html
http://abes.xchan.com/man3_3.html
http://abes.xchan.com/man3_4.html
http://abes.xchan.com/man4_3.html
http://abes.xchan.com/map1.html
http://abes.xchan.com/map2.html
http://abes.xchan.com/map3.html
http://abes.xchan.com/marge_1.html
http://abes.xchan.com/marge_2.html
http://abes.xchan.com/marge_3.html
http://abes.xchan.com/marge_4.html
http://abes.xchan.com/married.html
http://abes.xchan.com/married_1.html
http://abes.xchan.com/mature2_1.html
http://abes.xchan.com/mature2_2.html
http://abes.xchan.com/mature2_3.html
http://abes.xchan.com/mature2_4.html
http://abes.xchan.com/mature2_5.html
http://abes.xchan.com/mature2_6.html
http://abes.xchan.com/melayu_1.html
http://abes.xchan.com/melayu_2.html
http://abes.xchan.com/melayu_3.html
http://abes.xchan.com/melayu_4.html
http://abes.xchan.com/members.html
http://abes.xchan.com/members_1.html
http://abes.xchan.com/men2_4.html
http://abes.xchan.com/men2_5.html
http://abes.xchan.com/men2_6.html
http://abes.xchan.com/men2_8.html
http://abes.xchan.com/men2_9.html
http://abes.xchan.com/men6.html
http://abes.xchan.com/men6_5.html
http://abes.xchan.com/men6_6.html
http://abes.xchan.com/men6_7.html
http://abes.xchan.com/men6_8.html
http://abes.xchan.com/men6_9.html
http://abes.xchan.com/men10_5.html
http://abes.xchan.com/men10_6.html
http://abes.xchan.com/men11_4.html
http://abes.xchan.com/men11_5.html
http://abes.xchan.com/men11_6.html
http://abes.xchan.com/men12.html
http://abes.xchan.com/menstrua.html
http://abes.xchan.com/menstrua_1.html
http://abes.xchan.com/mepg_1.html
http://abes.xchan.com/mepg_2.html
http://abes.xchan.com/mepgs.html
http://abes.xchan.com/metaspid.html
http://abes.xchan.com/mission.html
http://abes.xchan.com/model.html
http://abes.xchan.com/model_1.html
http://abes.xchan.com/model_10.html
http://abes.xchan.com/model_11.html
http://abes.xchan.com/model_12.html
http://abes.xchan.com/model_13.html
http://abes.xchan.com/modle_2.html
http://abes.xchan.com/modle_3.html
http://abes.xchan.com/modle_4.html
http://abes.xchan.com/modle_5.html
http://abes.xchan.com/modles.html
http://abes.xchan.com/modles_1.html
http://abes.xchan.com/moon1_4.html
http://abes.xchan.com/moon1_5.html
http://abes.xchan.com/moon1_6.html
http://abes.xchan.com/moon2.html
http://abes.xchan.com/moon_8.html
http://abes.xchan.com/moon_9.html
http://abes.xchan.com/mov.html
http://abes.xchan.com/mov1.html
http://abes.xchan.com/mov3_1.html
http://abes.xchan.com/mov3_2.html
http://abes.xchan.com/mov3_7.html
http://abes.xchan.com/mov3_8.html
http://abes.xchan.com/mov4.html
http://abes.xchan.com/mov4_1.html
http://abes.xchan.com/mov_1.html
http://abes.xchan.com/mov_4.html
http://abes.xchan.com/mov_8.html
http://abes.xchan.com/mov_9.html
http://abes.xchan.com/move_3.html
http://abes.xchan.com/move_4.html
http://abes.xchan.com/move_5.html
http://abes.xchan.com/movei_3.html
http://abes.xchan.com/movei_4.html
http://abes.xchan.com/movei_5.html
http://abes.xchan.com/movi3_2.html
http://abes.xchan.com/movi3_3.html
http://abes.xchan.com/movi3_4.html
http://abes.xchan.com/movi3_5.html
http://abes.xchan.com/movi3_6.html
http://abes.xchan.com/movi4.html
http://abes.xchan.com/movi9_4.html
http://abes.xchan.com/movie3_5.html
http://abes.xchan.com/movie3_6.html
http://abes.xchan.com/movie3_7.html
http://abes.xchan.com/movie5_1.html
http://abes.xchan.com/movie5_2.html
http://abes.xchan.com/movie5_3.html
http://abes.xchan.com/movie_2.html
http://abes.xchan.com/movie_3.html
http://abes.xchan.com/movie_4.html
http://abes.xchan.com/movie_5.html
http://abes.xchan.com/movie_12.html
http://abes.xchan.com/movies1.html
http://abes.xchan.com/movies1_1.html
http://abes.xchan.com/movies1_10.html
http://abes.xchan.com/movies6.html
http://abes.xchan.com/movies8.html
http://abes.xchan.com/movies_4.html
http://abes.xchan.com/movies_5.html
http://abes.xchan.com/movies_9.html
http://abes.xchan.com/movis.html
http://abes.xchan.com/movis_1.html
http://abes.xchan.com/movis_2.html
http://abes.xchan.com/movis_3.html
http://abes.xchan.com/mpeg4.html
http://abes.xchan.com/mpeg4_1.html
http://abes.xchan.com/mpeg4_5.html
http://abes.xchan.com/mpeg5.html
http://abes.xchan.com/mpeg5_1.html
http://abes.xchan.com/mpeg5_2.html
http://abes.xchan.com/mpegs1_6.html
http://abes.xchan.com/mpegs1_7.html
http://abes.xchan.com/mpegs1_8.html
http://abes.xchan.com/mpegs1_9.html
http://abes.xchan.com/mpegs2.html
http://abes.xchan.com/mpegs2_1.html
http://abes.xchan.com/mpges_1.html
http://abes.xchan.com/mpgs_3.html
http://abes.xchan.com/mpgs_7.html
http://abes.xchan.com/mpgs_8.html
http://abes.xchan.com/mums.html
http://abes.xchan.com/mums_1.html
http://abes.xchan.com/nail1.html
http://abes.xchan.com/nail1_1.html
http://abes.xchan.com/nail1_2.html
http://abes.xchan.com/nail1_3.html
http://abes.xchan.com/nail1_4.html
http://abes.xchan.com/nail_8.html
http://abes.xchan.com/nails2_1.html
http://abes.xchan.com/nails2_2.html
http://abes.xchan.com/nails2_3.html
http://abes.xchan.com/nails2_4.html
http://abes.xchan.com/nails_5.html
http://abes.xchan.com/nake.html
http://abes.xchan.com/nake3_5.html
http://abes.xchan.com/nake3_6.html
http://abes.xchan.com/nake3_7.html
http://abes.xchan.com/nake3_8.html
http://abes.xchan.com/nake3_9.html
http://abes.xchan.com/nake4_4.html
http://abes.xchan.com/naked4_2.html
http://abes.xchan.com/naked4_3.html
http://abes.xchan.com/naked4_4.html

PlatformSocket Concept




Anthony Liguori's comments below have been reflected in the code (see boost/socket/impl/default_socket_impl.hpp in sandbox). There is now a Socket Implementation template parameter to the socket_base class. This page needs changing to reflect this...

Platform Socket Type



Provide a platform independent typedef for the platform dependent socket type

* socket_type
** Winsock2 : typedef SOCKET socket_type
** Unix : typedef int socket_type

Valid socket check




* bool is_valid(socket_type)
** Winsock2 : bool is_valid(socket_type socket) { return socket!=INVALID_SOCKET; }
** Unix : bool is_valid(socket_type socket) { return socket!=-1; }

Comments



Anthony Liguori: 11/23/2002

I think there may be a fundamental flaw in a two level approach. That is the library appears to be heading towards bit-level interoperability with C socket libraries. I am a much bigger fan of convertable compatibility though and there is a precedence for this approach in the standard (std::string). For instance, perhaps something like:

namespace boost {
namespace socket {
namespace platform {
struct Winsock2 {
typedef SOCKET socket_type;
socket_type s;
};
struct Berkley {
typedef int socket_type;
socket_type s;
};
}
}
struct <typename Platform=Berkley> // This could be determined rather easily at compile time
struct socket {
Platform::socket_type c_sock() {
return impl.s;
}
private:
Platform impl;
};
}

boost::socket s;

...

send(s.c_sock(), ...);

Of course, this is just an idea. The nice thing about an approach like this is that we don't lose the power of strong typing that C++ offers over C. I shudder to think that boost would provide a type that is merely a typedef to an int ;-)

I'd also like to speak to the moving of platform-dependent code to a policy. This is nice for a few reasons:

1) For platform that have multiple socket interfaces, a user can choose which one to use.

2) We can formally specify the requirements of a socket policy and provide reference implementations for common platforms. Additional platforms could be supported without modification to the actual library.

3) Features that are platform specific (i.e. asyncronous host name resolution) could be implemented using incomplete instantiation (see the policy chapter in Modern C++ Design). This way, we could provide standard interfaces for features that don't exist on all platforms and provide compile-time checking to determine if a particular platform supports the feature.

PlatformSocket Concept

Anthony Liguori's comments below have been reflected in the code (see boost/socket/impl/default_socket_impl.hpp in sandbox). There is now a Socket Implementation template parameter to the socket_base class. This page needs changing to reflect this...

Platform Socket Type

Provide a platform independent typedef for the platform dependent socket type

Valid socket check

Comments

Anthony Liguori: 11/23/2002

I think there may be a fundamental flaw in a two level approach. That is the library appears to be heading towards bit-level interoperability with C socket libraries. I am a much bigger fan of convertable compatibility though and there is a precedence for this approach in the standard (std::string). For instance, perhaps something like:

namespace boost {

  namespace socket {
    namespace platform {
      struct Winsock2 {
        typedef SOCKET socket_type;
        socket_type s;
      };
      struct Berkley {
        typedef int socket_type;
        socket_type s;
      };
    }
  }
  struct <typename Platform=Berkley> // This could be determined rather easily at compile time
  struct socket {
     Platform::socket_type c_sock() {
     return impl.s;
    }
  private:
    Platform impl;
  };
}

boost::socket s;

...

send(s.c_sock(), ...);

Of course, this is just an idea. The nice thing about an approach like this is that we don't lose the power of strong typing that C++ offers over C. I shudder to think that boost would provide a type that is merely a typedef to an int ;-)

I'd also like to speak to the moving of platform-dependent code to a policy. This is nice for a few reasons:

1) For platform that have multiple socket interfaces, a user can choose which one to use.

2) We can formally specify the requirements of a socket policy and provide reference implementations for common platforms. Additional platforms could be supported without modification to the actual library.

3) Features that are platform specific (i.e. asyncronous host name resolution) could be implemented using incomplete instantiation (see the policy chapter in Modern C++ Design). This way, we could provide standard interfaces for features that don't exist on all platforms and provide compile-time checking to determine if a particular platform supports the feature.


BOOST WIKI | BoostSocket | RecentChanges | Preferences | Page List | Links List
Edit text of this page | View other revisions
Last edited December 18, 2004 12:27 pm (diff)
Search:
Disclaimer: This site not officially maintained by Boost Developers