diff --git a/calexium_lib/CXM_message_constants.anubis b/calexium_lib/CXM_message_constants.anubis index 4dd2679..60d248b 100644 --- a/calexium_lib/CXM_message_constants.anubis +++ b/calexium_lib/CXM_message_constants.anubis @@ -43,3 +43,8 @@ public define Int32 _CXM_FTP_GET_FILE = 0x33771402. public define Int32 _CXM_FTP_START_TRANSFERT = 0x33771403. public define Int32 _CXM_FTP_DATA = 0x33771404. + // ************** LOGGER SERVICE ************** + +public define Int32 _CXM_LOGGER_SERVICE_MSG_BASIS = 0x33771800. // +public define Int32 _CXM_LOGGER_SERVICE_ID = 0x33771801. +public define Int32 _CXM_LOGGER_LOG = 0x33771802. diff --git a/calexium_lib/net_services/CXM_generic_protocol.anubis b/calexium_lib/net_services/CXM_generic_protocol.anubis index 2a64403..c4a5ac2 100644 --- a/calexium_lib/net_services/CXM_generic_protocol.anubis +++ b/calexium_lib/net_services/CXM_generic_protocol.anubis @@ -74,9 +74,20 @@ public define One { failure then send_ACK_error(queue, cmd_id), success(msg) then send_ACK_ok(queue, cmd_id, msg) - } - . + }. +public define One + send_result + ( + MessageQueue queue, + Int32 cmd_id, + Bool result + )= + if result then + send_ACK_ok(queue, cmd_id) + else + send_ACK_error(queue, cmd_id). + public define ProtocolResult wait_for_reply ( @@ -87,17 +98,18 @@ public define ProtocolResult if mQ.get_next_received_Message(t_out) is { timeout then timeout, - closed then println("wait_for_reply closed");failure, + closed then failure, //println("wait_for_reply closed"); + msg(_msg) then if *_msg.what = _CXM_ACK then if find_int32(_msg, "CMD") is { - failure then println("wait_for_reply CMD");failure, + failure then failure, //println("wait_for_reply CMD"); success(cmd) then - println("wait_for_reply CMD="+to_hexa(cmd)); +// println("wait_for_reply CMD="+to_hexa(cmd)); if find_int32(_msg, "STATUS") is { - failure then println("wait_for_reply STATUS");failure, + failure then failure, //println("wait_for_reply STATUS"); success(status) then if cmd = wait_cmd & status = _CXM_OK then if find_message(_msg, "RESULT") is @@ -110,10 +122,10 @@ public define ProtocolResult else if cmd = wait_cmd & status = _CXM_UNKNOW_CMD then unknow_cmd else - println("wait_for_reply ");failure + failure //println("wait_for_reply "); } } else - println("wait_for_reply not ACK");failure + failure //println("wait_for_reply not ACK"); }. diff --git a/calexium_lib/net_services/CXM_net_services.anubis b/calexium_lib/net_services/CXM_net_services.anubis index ae8c914..9fee4fe 100644 --- a/calexium_lib/net_services/CXM_net_services.anubis +++ b/calexium_lib/net_services/CXM_net_services.anubis @@ -91,7 +91,7 @@ define One List(NetService) net_services )= //TODO add a real management of error - println("Service NEGOCIATION [" + to_hexa(*msg.what) + "] received"); + //println("Service NEGOCIATION [" + to_hexa(*msg.what) + "] received"); if * msg.what = _CXM_REQUEST_FOR_SERVICE then if has_service(queue, msg, net_services) is { @@ -119,12 +119,12 @@ define One if queue.quit_requested(unique) then unique else - println("PRE SERVICE message_receiver "+"["+virtual_machine_id + "]"); + //println("PRE SERVICE message_receiver "+"["+virtual_machine_id + "]"); if queue.get_next_received_Message(1) is { timeout then println("PRE timeout");message_receiver(queue, net_services), closed then println("PRE closed");unique, - msg(msg) then println("PRE negociation"); + msg(msg) then unique; //println("PRE negociation"); service_negociation(queue, msg, net_services); message_receiver(queue, net_services) }. @@ -138,10 +138,10 @@ define Server -> (RWStream) -> One if remote_IP_address_and_port(conn) is (num_peer,_) then //convert IP address of the client to string with peer = ip_addr_to_string(num_peer), - println("NET SERVICES Accepting connection with "+peer); + //println("NET SERVICES Accepting connection with "+peer); //now managing the list of SERVICES - with queue = create_MessageQueue, + with queue = create_MessageQueue("CXM Net Services"), message_transceiver(conn, queue); message_receiver(queue, net_services). -- libgit2 0.21.4