Revision da5dade7 tests/echoServer.c

View differences:

tests/echoServer.c
131 131
      //strcpy(buffer, "Message for peer 2 \n");
132 132
      send_params sParams;
133 133
  
134
      send_Data(connectionID,buffer,size,msgtype,&sParams);
134
      mlSendData(connectionID,buffer,size,msgtype,&sParams);
135 135

  
136 136
}
137 137

  
......
172 172
  if (result != lSize){ fprintf(stderr,"Could not read file!\n");  }
173 173
  else { printf("The size of the file is %ld \n",lSize); }
174 174
  
175
  send_Data(connectionID,buf,(int)lSize,msgtype,&sParams);
175
  mlSendData(connectionID,buf,(int)lSize,msgtype,&sParams);
176 176

  
177 177
}
178 178

  
......
217 217
  */
218 218
void open_connection_cb(int fd, short event,void *arg){
219 219

  
220
  int con_id = open_connection(rm_socketID,&receive_conn_cb,&connection_argument); ///< try to open a connection to another peer. 
220
  int con_id = mlOpenConnection(rm_socketID,&receive_conn_cb,&connection_argument); ///< try to open a connection to another peer.
221 221
  ///If the result is zero the event is resheduled into the event list.
222 222
  if(con_id < 0){
223 223

  
......
262 262
    connectionID = connections[i];
263 263
    
264 264

  
265
  returnValue = recv_Data(connectionID,buffer,&size,&recvp);
265
  returnValue = mlRecvData(connectionID,buffer,&size,&recvp);
266 266

  
267
  //printf("--echoServer: after recv_Data \n");
267
  //printf("--echoServer: after mlRecvData \n");
268 268

  
269 269
  
270 270
  if (returnValue == 1){
271 271

  
272
    //printf("--echoServer: after recv_Data  \n");
272
    //printf("--echoServer: after mlRecvData  \n");
273 273

  
274 274
    unsigned char msgtype  = recvp.msgtype;
275 275
    int connectionID = recvp.connectionID;
......
355 355
    int connectionID = 0;
356 356
    send_params sParams;
357 357

  
358
    send_Data(connectionID,buffer,size,msgtype,&sParams);
358
    mlSendData(connectionID,buffer,size,msgtype,&sParams);
359 359

  
360 360
  }
361 361
  
......
515 515

  
516 516
  /// register the monitoring module callbacks 
517 517
  /// packet level callbacks 
518
  register_Get_recv_pkt_inf(&received_a_packet_monitoring_cb);
519
  register_Set_monitoring_header_pkt_cb(&set_monitoring_module_packet_header);
518
  mlRegisterGetRecvPktInf(&received_a_packet_monitoring_cb);
519
  mlRegisterSetMonitoringHeaderPktCb(&set_monitoring_module_packet_header);
520 520
  /// data level callbacks 
521
  register_get_recv_data_inf(&received_data_monitoring_cb);
522
  register_get_send_data_inf(&send_data_monitoring_cb);
523
  register_set_monitoring_header_data_cb(&set_monitoring_module_data_header);
521
  mlRegisterGetRecvDataInf(&received_data_monitoring_cb);
522
  mlRegisterGetSendDataInf(&send_data_monitoring_cb);
523
  mlRegisterSetMonitoringHeaderDataCb(&set_monitoring_module_data_header);
524 524

  
525 525
  /// register transmission callbacks
526
  register_Recv_connection_cb(&receive_conn_cb);
527
  register_Error_connection_cb(&conn_fail_cb);
526
  mlRegisterRecvConnectionCb(&receive_conn_cb);
527
  mlRegisterErrorConnectionCb(&conn_fail_cb);
528 528

  
529 529
  /// register a stun server on localhost with port 3478 
530
  //set_Stun_Server(3478,NULL);
530
  //mlSetStunServer(3478,NULL);
531 531

  
532 532
  //int peerID;
533 533
  peerID = atoi(argv[1]);
......
559 559

  
560 560
      /// call the init method and set the recv_data method to polling 
561 561
      boolean recv_data_cb1 = false;
562
      init_messaging_layer(recv_data_cb1,timeout_value,9001,NULL,3478,NULL,&receive_local_socketID_cb,(void*)base);
562
      mlInit(recv_data_cb1,timeout_value,9001,NULL,3478,NULL,&receive_local_socketID_cb,(void*)base);
563 563

  
564 564
      /// create a remote socketID --> implemented as a hack right now. In the final application a more clean solution of how to get the nodeIDs is required
565 565
      rm_socketID = getRemoteSocketID(2);
......
584 584

  
585 585
      /// call the init method and set the recv_data method to callback 
586 586
      boolean recv_data_cb2 = true;
587
      init_messaging_layer(recv_data_cb2,timeout_value,9002,NULL,3478,NULL,&receive_local_socketID_cb,(void*)base);
587
      mlInit(recv_data_cb2,timeout_value,9002,NULL,3478,NULL,&receive_local_socketID_cb,(void*)base);
588 588

  
589 589
      /// register a recv data callback for the  
590
      register_Recv_data_cb(&recv_data_from_peer_cb,12);
590
      mlRegisterRecvDataCb(&recv_data_from_peer_cb,12);
591 591

  
592 592
    break; 
593 593

  
......
598 598

  
599 599
      /// call the init method and set the recv_data method to callback
600 600
      boolean recv_data_cb3 = false;
601
      init_messaging_layer(recv_data_cb3,timeout_value,9003,NULL,3478,NULL,&receive_local_socketID_cb,(void*)base);
601
      mlInit(recv_data_cb3,timeout_value,9003,NULL,3478,NULL,&receive_local_socketID_cb,(void*)base);
602 602

  
603 603
      /// create a remote socketID --> implemented as a hack right now. In the final application a more clean solution of how to get the nodeIDs is required
604 604
      rm_socketID = getRemoteSocketID(1);

Also available in: Unified diff