nova proba

Revision:
19:7bdb1a10043f
Parent:
18:5ee53205451a
Child:
21:2232f5a34eb4
--- a/TcpServerToFlash.cpp	Sun May 17 17:16:03 2020 +0200
+++ b/TcpServerToFlash.cpp	Sat May 23 00:30:00 2020 +0200
@@ -33,14 +33,13 @@
 
 const char sendHTTPheader[]= "HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE html>";
 
-typedef void(*PF_PSTP)(struct SThreadParam *);
+typedef void(*PF_PSTP)(struct SThreadParam *);   // ne koristi se
 
 // parametri thread-a za uspostavljenje konekcije
 struct SThreadParam
 {
   Thread *p_Thread; // sopstveni pointer
   void * p_param;  // pointer za parametre thread-a, u ovom slucaju na socket koji je accept-van
-  PF_PSTP pf_pstp;  // pointer na funkciju koju thread callback-uje
 };
 
 /******************  inicijalizacija u mainu  ************************/
@@ -110,10 +109,10 @@
             struct SThreadParam *ps_thp = new struct SThreadParam;  // alokacija ps_thp
             ps_thp->p_param = (void*)p_soc;
             ps_thp->p_Thread = p_thr;
-            ps_thp->pf_pstp = rcpServerInstance_fun;
+        
         
             printf("TCPThread: NOVA KONEKCIJA!  thread %d   socket  %d   struct Sst %d\n\r", ps_thp->p_Thread, p_soc, ps_thp);fflush(stdout);
-            p_thr->start( callback( ps_thp->pf_pstp, ps_thp ));
+            p_thr->start( callback( rcpServerInstance_fun, ps_thp ));
 
 while(bws);
 
@@ -193,17 +192,21 @@
        printf("tcpServThread: ___stop komunikacije\n\r");
             
 //                        scomRxThreadCancel();
-                         tcpRxThreadsCancel();
+   //                      tcpRxThreadsCancel();
                 printf(" STACK: size=%d free=%d used=%d max used=%d\n\r", ps_thp->p_Thread->stack_size(),ps_thp->p_Thread->free_stack(),ps_thp->p_Thread->used_stack(),ps_thp->p_Thread->max_stack());
           //              udpRxThreadsCancel();
            //         wait(0.1);
                          gpc_html->htmlPOST_fun( );   // setovanje parametara u HTML format                         
                          putHTMLintoFLASH( gpc_html );   // upis parametara iz HTMLa u FLASH
+ 
+ //restart_TcpClientsConnection(1);
+ restart_TcpClients();
+
             // vratiti podatke iz Flasha u HTML !!!!!!
 //         ethRestart( );
        //     udpRxThreadsRiseUp( );
          //   scomRxThreadRiseUp( );
-            tcpRxThreadsRiseUp( );
+  //          tcpRxThreadsRiseUp( );
             
  restart = 1;
                       }