If you can edit the code, you can move the code to a destructor. For a form called 'Form1' the destructor would look like:
~Form1()
{
this.FtcpSock.Close();
this.FudpSock6800.Close();
this.FudpSock6801.Close();
this.FudpSock6802.Close();
this.FudpSock6803.Close();
this.FudpSock6804.Close();
this.FudpSock6806.Close();
}