none
VirtualChannelWrite gets hanged or failed RRS feed

  • Question

  • have a doubt in case of Virtual channeel Write function

    void WINAPI VirtualChannelOpenEvent(DWORD openHandle,
         UINT event, LPVOID pdata,
         UINT32 dataLength, UINT32 totalLength,
         UINT32 dataFlags)
    {
        switch (event)
         {
         case CHANNEL_EVENT_DATA_RECEIVED:          
    		 {
    //rECV DATA Perform some processing and then wite back to channel for server
    			// ULONG uLen =0;
    			 //BOOL bVal = gpEntryPoints->pVirtualChannelWrite(openHandle,"Hello",6,&uLen);
    			 MessageBox(NULL,TEXT("Okay"),TEXT("Sample App"),MB_OK);
    	
    		
               break;
    		 }
    
         case CHANNEL_EVENT_WRITE_CANCELLED:
              // the write operation has been canceled.
    		 
              break;
         case CHANNEL_EVENT_WRITE_COMPLETE:
    		 {
    		 }
         }
    
    }
    

    The above code works fine when i am using Virtualchannelwrite functionn under my VirtualChannelOpenEvent. Now conside another condition

    I have a Thread on my App In which i am processing some data and it take some 20 minute to process the data once data processing is over i want to send some data back to server so in that case if i use same code as i mention above for virtulachannelwrite

    // ULONG uLen =0;

     

    //BOOL bVal = gpEntryPoints->pVirtualChannelWrite(openHandle,"Hello",6,&uLen);

    MessageBox(NULL,TEXT(

    "Okay"),TEXT("Sample App"),MB_OK);

     

    It gets fail Note have checked all the handle which are proper so just want to know why it is failing under thread but not under VirtualChannelOpenEvent

    Thanks


    Rupesh Shukla
    Monday, April 12, 2010 10:44 PM

All replies