- int port;
-
- if(xId<globals->x1){
- strcpy(host,globals->west_host);
- port=globals->west_port;}
- else if(xId>globals->x2){
- strcpy(host,globals->east_host);
- port=globals->east_port;}
- else if(yId<globals->y1){
- strcpy(host,globals->south_host);
- port=globals->south_port;}
- else if(yId>globals->y2){
- strcpy(host,globals->north_host);
- port=globals->north_port;}
-
- msg->xId=xId;
- msg->yId=yId;
-
- gras_socket_t temp_sock;
- xbt_ex_t e; // the error variable used in TRY.. CATCH tokens.
- TRY{ // sending the nuke.
- temp_sock=gras_socket_client(host,port);
- }CATCH(e){
- RETHROW0("Unable to connect the nuke!: %s");
+ int port = 0;
+
+ if (xId < globals->x1) {
+ strcpy(host, globals->west_host);
+ port = globals->west_port;
+ } else if (xId > globals->x2) {
+ strcpy(host, globals->east_host);
+ port = globals->east_port;
+ } else if (yId < globals->y1) {
+ strcpy(host, globals->south_host);
+ port = globals->south_port;
+ } else if (yId > globals->y2) {
+ strcpy(host, globals->north_host);
+ port = globals->north_port;
+ }
+
+ msg->xId = xId;
+ msg->yId = yId;
+
+
+
+ TRY { // sending the nuke.
+ temp_sock = gras_socket_client(host, port);
+ }
+ CATCH_ANONYMOUS {
+ RETHROWF("Unable to connect the nuke!: %s");
+ }
+ //XBT_INFO("%s ON %s %d %d <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<",globals->host,host,xId,yId);
+ TRY {
+ gras_msg_send(temp_sock, "can_nuke", msg);