Hi, I was traying to remove an SMD port that has a plastic housing, like this:

(3 black ports at the left)
...and I was not able to do so. With a heat gun for electronics, I set it to 340ºC and by the time the solder joints were starting to move (but still had a long way), the plastic was already deformed and starting to burn.
I ended up switching to the most powerful soldering tip and removed the whole SMD with pure heat destruction and revenge, and soldered the cables directly to the board, quite hard, so tiny, and added some glue to make it tough.
So... first question is, how do you remove these?
I can only think of desoldering manually each pin/leg, really time consuming and tedious.
Second question, how do they solder these in the factories?
I am guessing you can't do it by heat as the plastic would melt, so... really, manually? So costly compared to "soldering ovens".
Third and last... thinking about heat gun destroying SMDs... microphones. Your typical SMD microphone:


Since that cannot be soldered with a soldering iron, it must be done with hot air by design, how do you avoid damaging the really thin membrane/diaphragm inside while doing so? How do you desolder these without destroying them?

(3 black ports at the left)
...and I was not able to do so. With a heat gun for electronics, I set it to 340ºC and by the time the solder joints were starting to move (but still had a long way), the plastic was already deformed and starting to burn.
I ended up switching to the most powerful soldering tip and removed the whole SMD with pure heat destruction and revenge, and soldered the cables directly to the board, quite hard, so tiny, and added some glue to make it tough.
So... first question is, how do you remove these?
I can only think of desoldering manually each pin/leg, really time consuming and tedious.
Second question, how do they solder these in the factories?
I am guessing you can't do it by heat as the plastic would melt, so... really, manually? So costly compared to "soldering ovens".
Third and last... thinking about heat gun destroying SMDs... microphones. Your typical SMD microphone:


Since that cannot be soldered with a soldering iron, it must be done with hot air by design, how do you avoid damaging the really thin membrane/diaphragm inside while doing so? How do you desolder these without destroying them?