Move datadesc and TCP sockets from GRAS to XBT. XBT supports sockets with explicit choice of the transport plugin. XBT provides only one transport plugin: TCP (i.e. real sockets) and allows other layers to write their custom plugins. GRAS implements such custom plugins: simulated sockets and file sockets. TCP sockets only existed in GRAS RL mode. They can now also be used in GRAS SG mode. More pieces of GRAS remain to be moved to XBT before TCP sockets can also be used outside GRAS (e.g. in SIMIX 3, one day, to distribute the simulation).
Use xbt_XXX_is_empty() instead of testing xbt_XXX_length() against 0. Where XXX is 'dict' or 'dynar'. (was a request from emptty)
Kill "if" before free, and useless cast of free argument. free(NULL) is a no-op, there is no need to test the given pointer before call. The same argument stands for xbt_free, xbt_dict_free, xbt_dynar_free, and xbt_strbuff_free.
Do not fail if getprotobyname(tcp) returns NULL, as it happens on powerpc buildd
Remove usage of xbt_assert[0-9]. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9858 48e7efb5-ca39-0410-a469-dd3cf9ba447f
Use new macros THROWF and RETHROWF. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9856 48e7efb5-ca39-0410-a469-dd3cf9ba447f
Make XBT_{IN,OUT,HERE} function-like macros. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9655 48e7efb5-ca39-0410-a469-dd3cf9ba447f
Use new style logging macros. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9653 48e7efb5-ca39-0410-a469-dd3cf9ba447f
Partial fix of GRAS: gras-ping-sg now works again * Make the following function specific to the plugins: - gras_socket_my_port(sock) - gras_socket_peer_port(sock) - gras_socket_peer_name(sock) - gras_socket_peer_proc(sock) - gras_socket_peer_proc_set(sock,peer_proc) * In SG plugin, implement them properly knowing that the same socket object gets shared between peers * In TCP plugin, use the previous behavior * In file plugin, use THROW_UNIMPLEMENTED git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8545 48e7efb5-ca39-0410-a469-dd3cf9ba447f
Indent include and src using this command: indent -kr -br -brs -ce -bbo --dont-break-procedure-type --no-tabs --cuddle-do-while --cuddle-else --indent-level2 --leave-preprocessor-space --no-space-after-function-call-names I also had to play with fromdos and to check that sg_unit_extractor.pl did not get fooled by XBT_TEST_UNIT lines splitted in half by indent. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8394 48e7efb5-ca39-0410-a469-dd3cf9ba447f
Fix copyright headers git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7646 48e7efb5-ca39-0410-a469-dd3cf9ba447f
Kill old $Id$ command dating from CVS git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7645 48e7efb5-ca39-0410-a469-dd3cf9ba447f
Revert "try to port the gras simulation side to the new smx_network infrastructure (not yet working)" This git branch is not ready for public consumption yet (sorry) This reverts commit 063c63642a29000a011c0d6176d30eb62a4e0dca. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6836 48e7efb5-ca39-0410-a469-dd3cf9ba447f
try to port the gras simulation side to the new smx_network infrastructure (not yet working) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6835 48e7efb5-ca39-0410-a469-dd3cf9ba447f
Reindent everything (possibly breaking all branches, but for the last time) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6309 48e7efb5-ca39-0410-a469-dd3cf9ba447f
do not close sockets from main thread, but from listener (queue added for that) because the listener is selecting on that sock, and it makes darwin angry to close selected sockets git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6242 48e7efb5-ca39-0410-a469-dd3cf9ba447f
reduce the verbosity of *all* setsockopt failures to set buffer sizes to keep darwin's mouth shut git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6241 48e7efb5-ca39-0410-a469-dd3cf9ba447f
lower the gravity of the message indicating that setsockopt failed to set the buffer sizes. It do fail on darwin, but I doubt nowadays that this setting does any good. OSes know better than me what the good buffer size should be. Maybe we should kill that completely git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6237 48e7efb5-ca39-0410-a469-dd3cf9ba447f
Do not use recv() but read() to check whether a socket returned by select() is valid to use or good to close. That way, it works not only for real sockets but also for file ones. This implies having a 1-byte-long buffer in the socket for the data we got during this check, and using this micro buffer before the rest of the content in the gras_*_recv() git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4796 48e7efb5-ca39-0410-a469-dd3cf9ba447f
Yeah, right. We should prevent to push the socket into the dynar in gras_trp_socket_new to prevent the listener from using it before it gets ready, but we still should push it one day (wasn't done for accepted sockets nor file sockets) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4028 48e7efb5-ca39-0410-a469-dd3cf9ba447f