- xbt_assert0(WSAStartup(wVersionRequested, &wsaData) == 0,
- "Cannot find a usable WinSock DLL");
+ int res;
+ res = WSAStartup(wVersionRequested, &wsaData);
+ xbt_assert(res == 0, "Cannot find a usable WinSock DLL");
/* Confirm that the WinSock DLL supports 2.0. */
/* Note that if the DLL supports versions greater */
/* Confirm that the WinSock DLL supports 2.0. */
/* Note that if the DLL supports versions greater */
HIBYTE(wsaData.wVersion) == 0,
"Cannot find a usable WinSock DLL");
HIBYTE(wsaData.wVersion) == 0,
"Cannot find a usable WinSock DLL");
- xbt_assert0(WSAStartup(0x0101, &wsaData) == 0,
- "Cannot find a usable WinSock DLL");
- INFO0("Found and initialized winsock");
+ int res;
+ res = WSAStartup(0x0101, &wsaData);
+ xbt_assert(res == 0, "Cannot find a usable WinSock DLL");
+ XBT_INFO("Found and initialized winsock");
gras_socket_server_ext(unsigned short port,
unsigned long int buf_size, int measurement)
{
gras_socket_server_ext(unsigned short port,
unsigned long int buf_size, int measurement)
{
gras_if_RL()? "tcp" : "sg", port);
trp = gras_trp_plugin_get_by_name(gras_if_SG()? "sg" : "tcp");
gras_if_RL()? "tcp" : "sg", port);
trp = gras_trp_plugin_get_by_name(gras_if_SG()? "sg" : "tcp");
sock->incoming ? 'y' : 'n',
sock->outgoing ? 'y' : 'n', sock->accepting ? 'y' : 'n');
sock->incoming ? 'y' : 'n',
sock->outgoing ? 'y' : 'n', sock->accepting ? 'y' : 'n');
gras_if_RL()? "tcp" : "sg");
/* defaults settings */
gras_trp_socket_new(0, &sock);
gras_if_RL()? "tcp" : "sg");
/* defaults settings */
gras_trp_socket_new(0, &sock);
/* plugin-specific */
TRY {
(*trp->socket_client) (trp,host,port,sock);
/* plugin-specific */
TRY {
(*trp->socket_client) (trp,host,port,sock);
sock->incoming ? 'y' : 'n',
sock->outgoing ? 'y' : 'n', sock->accepting ? 'y' : 'n');
sock->incoming ? 'y' : 'n',
sock->outgoing ? 'y' : 'n', sock->accepting ? 'y' : 'n');
("Closing a socket having more data in buffer. Option nomoredata_on_close disabled, so continuing.");
_gras_lastly_selected_socket = NULL;
}
/* FIXME: Issue an event when the socket is closed */
("Closing a socket having more data in buffer. Option nomoredata_on_close disabled, so continuing.");
_gras_lastly_selected_socket = NULL;
}
/* FIXME: Issue an event when the socket is closed */
if (sock) {
/* FIXME: Cannot get the dynar mutex, because it can be already locked */
// _xbt_dynar_foreach(sockets,cursor,sock_iter) {
for (cursor = 0; cursor < xbt_dynar_length(sockets); cursor++) {
_xbt_dynar_cursor_get(sockets, cursor, &sock_iter);
if (sock == sock_iter) {
if (sock) {
/* FIXME: Cannot get the dynar mutex, because it can be already locked */
// _xbt_dynar_foreach(sockets,cursor,sock_iter) {
for (cursor = 0; cursor < xbt_dynar_length(sockets); cursor++) {
_xbt_dynar_cursor_get(sockets, cursor, &sock_iter);
if (sock == sock_iter) {
xbt_dynar_length(sockets));
xbt_dynar_cursor_rm(sockets, &cursor);
if (sock->plugin->socket_close)
xbt_dynar_length(sockets));
xbt_dynar_cursor_rm(sockets, &cursor);
if (sock->plugin->socket_close)
("Ignoring request to free an unknown socket (%p). Execution stack:",
sock);
xbt_backtrace_display_current();
}
("Ignoring request to free an unknown socket (%p). Execution stack:",
sock);
xbt_backtrace_display_current();
}
*/
void gras_trp_send(gras_socket_t sd, char *data, long int size, int stable)
{
*/
void gras_trp_send(gras_socket_t sd, char *data, long int size, int stable)
{
- xbt_assert0(sd->outgoing, "Socket not suited for data send");
- (*sd->plugin->send) (sd, data, size, stable);
+ xbt_assert(sd->outgoing, "Socket not suited for data send");
+ sd->plugin->send(sd, data, size, stable);
- THROW1(unknown_error,0,"Function my_port unimplemented in plugin %s",sock->plugin->name);
- return (*sock->plugin->my_port)(sock);
+ THROWF(unknown_error,0,"Function my_port unimplemented in plugin %s",sock->plugin->name);
+ return sock->plugin->my_port(sock);
- THROW1(unknown_error,0,"Function peer_port unimplemented in plugin %s",sock->plugin->name);
- return (*sock->plugin->peer_port)(sock);
+ THROWF(unknown_error,0,"Function peer_port unimplemented in plugin %s",sock->plugin->name);
+ return sock->plugin->peer_port(sock);
- XBT_IN;
- THROW0(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
+ XBT_IN("");
+ THROWF(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
"If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
if (gras_if_RL())
chunk = xbt_malloc0(msg_size);
"If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
if (gras_if_RL())
chunk = xbt_malloc0(msg_size);
"Socket not suited for data send (was created with gras_socket_server(), not gras_socket_client())");
for (sent_sofar = 0; sent_sofar < msg_amount; sent_sofar++) {
"Socket not suited for data send (was created with gras_socket_server(), not gras_socket_client())");
for (sent_sofar = 0; sent_sofar < msg_amount; sent_sofar++) {
"Sent %lu msgs of %lu (size of each: %ld) to %s:%d",
sent_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
gras_socket_peer_port(peer));
"Sent %lu msgs of %lu (size of each: %ld) to %s:%d",
sent_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
gras_socket_peer_port(peer));
"Sent %lu msgs of %lu (size of each: %ld) to %s:%d", sent_sofar,
msg_amount, msg_size, gras_socket_peer_name(peer),
gras_socket_peer_port(peer));
"Sent %lu msgs of %lu (size of each: %ld) to %s:%d", sent_sofar,
msg_amount, msg_size, gras_socket_peer_name(peer),
gras_socket_peer_port(peer));
- XBT_IN;
- THROW0(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
+ XBT_IN("");
+ THROWF(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
"If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
if (gras_if_RL())
chunk = xbt_malloc(msg_size);
"If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
if (gras_if_RL())
chunk = xbt_malloc(msg_size);
"Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
got_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
gras_socket_peer_port(peer));
(peer->plugin->raw_recv) (peer, chunk, msg_size);
}
"Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
got_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
gras_socket_peer_port(peer));
(peer->plugin->raw_recv) (peer, chunk, msg_size);
}
"Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
got_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
gras_socket_peer_port(peer));
if (gras_if_RL())
free(chunk);
"Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
got_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
gras_socket_peer_port(peer));
if (gras_if_RL())
free(chunk);
- THROW0(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
+ THROWF(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
"If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
"If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
s, gras_socket_peer_name(s), gras_socket_peer_port(s),
s->valid ? "(valid)" : "(peer dead)");
}
s, gras_socket_peer_name(s), gras_socket_peer_port(s),
s->valid ? "(valid)" : "(peer dead)");
}