diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-10-11 00:57:08 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-10-11 00:57:08 +0000 |
commit | 6345981a237967e0ba2849ded171c85af0c91eaa (patch) | |
tree | e4147344f26f8064491ad6f2d5eb847f32307e10 /examples | |
parent | 6ef8157e014a7204e1d2439fdfa28330a35bc579 (diff) | |
download | ATCD-6345981a237967e0ba2849ded171c85af0c91eaa.tar.gz |
ChangeLogTag:Tue Oct 10 17:25:32 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/RMCast/Send_File/Makefile | 315 | ||||
-rw-r--r-- | examples/RMCast/Send_File/Receiver.cpp | 53 | ||||
-rw-r--r-- | examples/RMCast/Send_File/Sender.cpp | 8 |
3 files changed, 360 insertions, 16 deletions
diff --git a/examples/RMCast/Send_File/Makefile b/examples/RMCast/Send_File/Makefile index 9ec83518af5..9ae6d7b5732 100644 --- a/examples/RMCast/Send_File/Makefile +++ b/examples/RMCast/Send_File/Makefile @@ -34,4 +34,319 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU #---------------------------------------------------------------------------- # DO NOT DELETE THIS LINE -- g++dep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + + +.obj/Sender.o .obj/Sender.so .shobj/Sender.o .shobj/Sender.so: Sender.cpp \ + $(ACE_ROOT)/ace/RMCast/RMCast_UDP_Reliable_Sender.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Singleton_Factory.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Module_Factory.h \ + $(ACE_ROOT)/ace/RMCast/RMCast.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Export.h \ + $(ACE_ROOT)/ace/RMCast/RMCast.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Module_Factory.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Singleton_Factory.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_IO_UDP.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Module.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Module.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/QoS_Session.h \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Based_Pointer_T.h \ + $(ACE_ROOT)/ace/Based_Pointer_T.i \ + $(ACE_ROOT)/ace/Based_Pointer_T.cpp \ + $(ACE_ROOT)/ace/Based_Pointer_Repository.h \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_IO_UDP.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Sequencer.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Sequencer.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Retransmission.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Copy_On_Write.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Worker.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Worker.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Worker.cpp \ + $(ACE_ROOT)/ace/RMCast/RMCast_Copy_On_Write.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Copy_On_Write.cpp \ + $(ACE_ROOT)/ace/RB_Tree.h \ + $(ACE_ROOT)/ace/RB_Tree.i \ + $(ACE_ROOT)/ace/RB_Tree.cpp \ + $(ACE_ROOT)/ace/RMCast/RMCast_Retransmission.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Membership.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Membership.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Fragment.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Fragment.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Control_Splitter.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Control_Splitter.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_UDP_Reliable_Sender.i \ + $(ACE_ROOT)/ace/FILE_IO.h \ + $(ACE_ROOT)/ace/FILE.h \ + $(ACE_ROOT)/ace/IO_SAP.h \ + $(ACE_ROOT)/ace/IO_SAP.i \ + $(ACE_ROOT)/ace/FILE_Addr.h \ + $(ACE_ROOT)/ace/FILE_Addr.i \ + $(ACE_ROOT)/ace/FILE.i \ + $(ACE_ROOT)/ace/FILE_IO.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp + +.obj/Receiver.o .obj/Receiver.so .shobj/Receiver.o .shobj/Receiver.so: Receiver.cpp \ + $(ACE_ROOT)/ace/RMCast/RMCast_UDP_Reliable_Receiver.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Singleton_Factory.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Module_Factory.h \ + $(ACE_ROOT)/ace/RMCast/RMCast.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Export.h \ + $(ACE_ROOT)/ace/RMCast/RMCast.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Module_Factory.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Singleton_Factory.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_Reliable_Factory.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Reliable_Factory.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_IO_UDP.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Module.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_Module.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/QoS_Session.h \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Based_Pointer_T.h \ + $(ACE_ROOT)/ace/Based_Pointer_T.i \ + $(ACE_ROOT)/ace/Based_Pointer_T.cpp \ + $(ACE_ROOT)/ace/Based_Pointer_Repository.h \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/RMCast/RMCast_IO_UDP.i \ + $(ACE_ROOT)/ace/RMCast/RMCast_UDP_Reliable_Receiver.i \ + $(ACE_ROOT)/ace/FILE_IO.h \ + $(ACE_ROOT)/ace/FILE.h \ + $(ACE_ROOT)/ace/IO_SAP.h \ + $(ACE_ROOT)/ace/IO_SAP.i \ + $(ACE_ROOT)/ace/FILE_Addr.h \ + $(ACE_ROOT)/ace/FILE_Addr.i \ + $(ACE_ROOT)/ace/FILE.i \ + $(ACE_ROOT)/ace/FILE_IO.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp + # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/examples/RMCast/Send_File/Receiver.cpp b/examples/RMCast/Send_File/Receiver.cpp index 0b4455f6935..22a9a9c310e 100644 --- a/examples/RMCast/Send_File/Receiver.cpp +++ b/examples/RMCast/Send_File/Receiver.cpp @@ -13,17 +13,19 @@ public: File_Module (void); /// Return 1 if all the data has been received - int all_received (void) const; + int status (void) const; /// Initialize the module int open (const char *filename); int close (void); int data (ACE_RMCast::Data &data); + int ack_join (ACE_RMCast::Ack_Join &ack_join); + int ack_leave (ACE_RMCast::Ack_Leave &ack_leave); private: /// Set to 1 when the last block is received - int all_received_; + int status_; /// Used to dump the received data into a file ACE_FILE_IO file_io_; @@ -56,7 +58,8 @@ main (int argc, char *argv[]) if (mcast_group.set (argv[2]) != 0) { ACE_ERROR_RETURN ((LM_ERROR, - "Cannot read file <%s>\n", filename), + "Cannot setup multicast group <%s>\n", + argv[2]), 1); } @@ -78,14 +81,14 @@ main (int argc, char *argv[]) do { // Try for 50 milliseconds... - ACE_Time_Value tv(0, 50000); + ACE_Time_Value tv (5, 0); // 0, 50000); int r = reactor->handle_events (&tv); if (r == -1) break; } - while (file_module.all_received () == 0); + while (file_module.status () != 2); - (void) file_module.close (); + ACE_DEBUG ((LM_DEBUG, "event loop completed\n")); return 0; } @@ -93,20 +96,22 @@ main (int argc, char *argv[]) // **************************************************************** File_Module::File_Module (void) - : all_received_ (0) + : status_ (0) { } int -File_Module::all_received (void) const +File_Module::status (void) const { - return this->all_received_; + return this->status_; } int File_Module::open (const char * filename) { - ACE_HANDLE handle = ACE_OS::open (filename, O_WRONLY|O_BINARY|O_CREAT); + ACE_HANDLE handle = ACE_OS::open (filename, + O_WRONLY|O_BINARY|O_CREAT, + 0644); if (handle == ACE_INVALID_HANDLE) { ACE_ERROR_RETURN ((LM_ERROR, @@ -120,6 +125,7 @@ File_Module::open (const char * filename) int File_Module::close (void) { + ACE_DEBUG ((LM_DEBUG, "File_Module closed\n")); (void) this->file_io_.close (); return 0; } @@ -127,11 +133,34 @@ File_Module::close (void) int File_Module::data (ACE_RMCast::Data &data) { + if (this->status_ == 1) + return -1; + size_t length = data.payload->length () - 1; (void) this->file_io_.send (data.payload->rd_ptr () + 1, length); if (*(data.payload->rd_ptr ()) == 'E') - this->all_received_ = 1; - + { + this->status_ = 1; + return -1; + } + + return 0; +} + +int +File_Module::ack_join (ACE_RMCast::Ack_Join &) +{ + ACE_DEBUG ((LM_DEBUG, + "File_Module::ack_join\n")); + return 0; +} + +int +File_Module::ack_leave (ACE_RMCast::Ack_Leave &) +{ + ACE_DEBUG ((LM_DEBUG, + "File_Module::ack_leave\n")); + this->status_ = 2; return 0; } diff --git a/examples/RMCast/Send_File/Sender.cpp b/examples/RMCast/Send_File/Sender.cpp index 5c065db9f67..2afa59de6e6 100644 --- a/examples/RMCast/Send_File/Sender.cpp +++ b/examples/RMCast/Send_File/Sender.cpp @@ -65,7 +65,7 @@ main (int argc, char *argv[]) sender.reactive_incoming_messages (reactor); { // Resend the messages every 20 milliseconds.. - ACE_Time_Value tv (0, 20000); + ACE_Time_Value tv (2, 0); sender.reactive_resends (reactor, tv); } @@ -96,7 +96,7 @@ main (int argc, char *argv[]) } // Handle incoming events, without blocking... - ACE_Time_Value tv (0); + ACE_Time_Value tv (4, 0); reactor->handle_events (&tv); } @@ -104,12 +104,12 @@ main (int argc, char *argv[]) do { // Try for 50 milliseconds... - ACE_Time_Value tv(0, 50000); + ACE_Time_Value tv (5, 0); int r = reactor->handle_events (&tv); if (r == -1) break; } - while (sender.has_data ()); + while (sender.has_data () || sender.has_members ()); return 0; } |