-static const char* gras_trp_sg_peer_name(gras_socket_t s) {
- gras_trp_sg_sock_data_t sockdata = s->data;
- if (sockdata->server == SIMIX_process_self())
- return SIMIX_host_get_name(SIMIX_process_get_host(sockdata->client));
- else
- return SIMIX_host_get_name(SIMIX_process_get_host(sockdata->server));
+
+static const char* gras_trp_sg_peer_name(xbt_socket_t s)
+{
+ gras_trp_sg_sock_data_t sockdata = xbt_socket_get_data(s);
+ if (gras_socket_im_the_server(s))
+ return SIMIX_host_get_name(simcall_process_get_host(sockdata->client));
+ else {
+ return SIMIX_host_get_name(simcall_process_get_host(sockdata->server));
+ }