Cannot change transistor State in peer to peer communication of ESP32 boards

I haven't read your code.

Anyway I can ask a question: did you try to veryfy if your "get" part works at all by printing to the serial monitor?

I don't know any details about how "get" over Wifi works. But the receiving unit is receiving "something" I guess some characters at least. So it should be possible to print the received characters to the serial monitor to analyse what character-sequence is the receiving unit really receiving.

the while(1) loop under loop itself is not nescessary
inside function taskWifi()
you have a blocking loop while(1)

are you sure that this is working?

best regards Stefan