diff options
author | naga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-04-20 20:42:45 +0000 |
---|---|---|
committer | naga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-04-20 20:42:45 +0000 |
commit | 8ea84076a35728eaafe6f481630b7c76ac0654fd (patch) | |
tree | adc3854d336a53e2b6c7929f4303c2ac16256a4b /TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client | |
parent | f2d396c5a31c1aed0e5a994db7a7c0ca6dce02e3 (diff) | |
download | ATCD-8ea84076a35728eaafe6f481630b7c76ac0654fd.tar.gz |
*** empty log message ***
Diffstat (limited to 'TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client')
4 files changed, 39 insertions, 26 deletions
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp index 14fd79ccce6..4e2f0ecd219 100644 --- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp @@ -244,6 +244,11 @@ Command_Handler::init_av (void) int i, j; + // if (this->orb_manager_ != 0) + // delete this->orb_manager_; + + // init the ORB manager. + // this->init (); /* try to stop and close previous playing */ if (audioSocket >= 0 || videoSocket >= 0) { @@ -271,7 +276,7 @@ Command_Handler::init_av (void) } usleep(10000); this->close (); - ComCloseConn(videoSocket); + // ComCloseConn(videoSocket); videoSocket = -1; while ((!VBbufEmpty()) || !VDbufEmpty()) { while (VDpeekMsg() != NULL) { @@ -764,7 +769,7 @@ int Command_Handler::close (void) { // flag to call close only once. - static called = 0; + // static called = 0; // if (audioSocket >=0) // { // int result = @@ -782,9 +787,9 @@ Command_Handler::close (void) // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n", __LINE__, __FILE__)); // } // } - if (!called) - { - called =1; + // if (!called) + // { + // called =1; TAO_TRY { if (CORBA::is_nil (this->audio_control_.in ()) == CORBA::B_FALSE) @@ -811,8 +816,8 @@ Command_Handler::close (void) } TAO_ENDTRY; return 0; - } - return 0; + // } + // return 0; } @@ -1516,6 +1521,7 @@ Command_Handler::connect_to_video_server (char *address, ACE_INET_Addr server_addr (VCR_TCP_PORT, address); + this->video_stream_.close (); if (this->video_connector_.connect (this->video_stream_, server_addr) == -1) ACE_ERROR_RETURN ((LM_ERROR, @@ -1549,6 +1555,7 @@ Command_Handler::connect_to_video_server (char *address, ACE_NEW_RETURN (client_address_string, char [BUFSIZ], -1); + this->video_dgram_.close (); // Get the local UDP address if (this->video_dgram_.open (ACE_Addr::sap_any) == -1) ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t)datagram open failed %p"),-1); @@ -1629,6 +1636,7 @@ Command_Handler::connect_to_audio_server (char *address, ACE_INET_Addr server_addr (VCR_TCP_PORT, address); + this->audio_stream_.close (); if (this->audio_connector_.connect (this->audio_stream_, server_addr) == -1) ACE_ERROR_RETURN ((LM_ERROR, @@ -1643,9 +1651,7 @@ Command_Handler::connect_to_audio_server (char *address, int ack; this->audio_stream_.recv_n (&ack, sizeof (ack)); - // ACE_DEBUG ((LM_DEBUG, - // "(%P|%t) got ack :%d\n", - // ack)); + ACE_DEBUG ((LM_DEBUG,"(%P|%t) got ack :%d\n",ack)); // initialize the command handler , ORB if (this->resolve_audio_reference () == -1) @@ -1661,6 +1667,7 @@ Command_Handler::connect_to_audio_server (char *address, ACE_NEW_RETURN (client_address_string, char [BUFSIZ], -1); + this->audio_dgram_.close (); // Get the local UDP address if (this->audio_dgram_.open (ACE_Addr::sap_any) == -1) ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t)datagram open failed %p"),-1); diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ab.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ab.cpp index b1ced0c3333..7dfc22bc911 100644 --- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ab.cpp +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ab.cpp @@ -168,13 +168,9 @@ void ABdeleteSem(void) /* SIGUSR1 from CTR is for killing this process, without affecting any other ones. */ -static void usr1_handler(int sig) -{ - exit_tag = 1; -} - static void exit_on_kill(void) { + ACE_DEBUG ((LM_DEBUG,"(%P|%t) ABprocess killed \n")); extern void set_exit_routine_tag(int tag); set_exit_routine_tag(0); ComCloseConn(savedSocket); @@ -182,6 +178,13 @@ static void exit_on_kill(void) exit(0); } +static void usr1_handler(int sig) +{ + cerr << "ABprocess got sigusr1\n"; + exit_on_kill (); +} + + static void usr2_handler(int sig) { Fprintf(stderr, "VB void usr2_handler (supposed for stat).\n"); diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ctr.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ctr.cpp index edde8565fd4..60045342abc 100644 --- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ctr.cpp +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ctr.cpp @@ -233,8 +233,7 @@ static void CmdWrite(unsigned char * buf, int size) static void SocketRead(int s, char *buf, int size) { int val, remain = size; char * ptr = buf; - fprintf (stderr, "SocketRead: videoSocket = %d\n", - videoSocket); + // fprintf (stderr, "SocketRead: videoSocket = %d\n",videoSocket); for (;;) { val = read(s, ptr, remain); @@ -2991,10 +2990,10 @@ int CTRmain(void) // -1); // if (command_handler->init () == -1) - if (command_handler.init () == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) command_handler: init returned -1"), - -1); + if (command_handler.init () == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) command_handler: init returned -1"), + -1); // .. and register it with the reactor. if (ACE_Reactor::instance ()->register_handler (&command_handler, diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vb.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vb.cpp index 7456d583bd8..3e8fc9f3d84 100644 --- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vb.cpp +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vb.cpp @@ -162,13 +162,9 @@ void VBdeleteSem(void) /* SIGUSR1 from CTR is for killing this process, without affecting any other ones. */ -static void usr1_handler(int sig) -{ - exit_tag = 1; -} - static void exit_on_kill(void) { + ACE_DEBUG ((LM_DEBUG,"(%P|%t) VBProcess killed\n")); extern void set_exit_routine_tag(int tag); set_exit_routine_tag(0); ComCloseConn(savedSocket); @@ -176,6 +172,14 @@ static void exit_on_kill(void) exit(0); } +static void usr1_handler(int sig) +{ + cerr << "VBProcess got sigusr1\n"; + exit_on_kill (); + exit_tag = 1; +} + + static void usr2_handler(int sig) { /* |