- xbt_dynar_length(my_sockets));
- xbt_dynar_cursor_rm(my_sockets, &cursor);
- gras_msg_listener_close_socket(sock);
+ xbt_dynar_length(sockets));
+ xbt_dynar_cursor_rm(sockets, &cursor);
+ if (sock->plugin->socket_close)
+ (*sock->plugin->socket_close) (sock);
+
+ /* free the memory */
+ if (sock->peer_name)
+ free(sock->peer_name);
+ free(sock);